Object Oriented Design. Object-Oriented Design Method for designing computer programs –Useful for thinking about large problems Consider “objects” interacting.

Slides:



Advertisements
Similar presentations
1 © Wolfgang Pelz CRC Cards CRC Cards (class-responsibility-collaborator)
Advertisements

Black Jack in Objective-C
1 CSC 222: Computer Programming II Spring 2004 HW1 review arrays vs. vectors class design object-oriented design data objects + functionality example:
1 CSC 221: Introduction to Programming Fall 2011 List comprehensions & objects building strings & lists comprehensions conditional comprehensions example:
Topics in Python Blackjack & TKinter
AP Computer Science A – Healdsburg High School 1 Unit 3 - Classes and Objects - Example.
CRC Cards (class-responsibility-collaborator)
It’s All in the Cards Adding and Subtracting Integers
Binder Object-Oriented Testing Metrics. Lack of Cohesion in Methods b b In order to calculate the lack of Cohesion in methods, the Software Engineer must.
Design Example. Requirements Make a program that simulates the game of blackjack For now, we ignore money/betting…. just simulate game play But… this.
Elevens Lab Student Material – on website
CS 106 Introduction to Computer Science I 04 / 02 / 2008 Instructor: Michael Eckmann.
Centinel tournament ● A deck: the numbers in random order ● A game lasts until no numbers are left in deck ● A game is played like this (first player.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
ECS15 sequence. Sequences  There are three kinds of sequences in Python: Strings – we use these a lot. “albatross” Lists – we saw those last time, they.
Exercise Exercise Exercise Exercise
Exercise Exercise Exercise Exercise
Building Memory… Notes from class on 11/13/06. The Game Think about what types of objects we will need in our system and some of the properties and capabilities.
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
Java Coding 8 David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. Object-Oriented Design Examples.
CS 106 Introduction to Computer Science I 11 / 08 / 2006 Instructor: Michael Eckmann.
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
CS 106 Introduction to Computer Science I 04 / 07 / 2010 Instructor: Michael Eckmann.
o Simulate a deck of playing cards o Shuffle the deck o Deal (5) cards into the hand o Turn over the first card o The user must guess whether the next.
o Simulate a deck of playing cards o Shuffle the deck o Deal 5 cards into the hand o Turn over the first card o The user must guess whether the next card.
VOCABULARY  Deck or pack  Suit  Hearts  Clubs  Diamonds  Spades  Dealer  Shuffle  Pick up  Rank  Draw  Set  Joker  Jack 
1 CSE 403 Design and UML Class Diagrams Reading: UML Distilled Ch. 3, by M. Fowler These lecture slides are copyright (C) Marty Stepp, They may not.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
UML January 24, 2011 CSE 403, Winter 2011, Brun Design and UML Class Diagrams.
Can Programmers do Course Design?. The Programmer.
Marie-Luce Bourguet Projects in the areas of: Multimedia processing Multimedia / Web design.
Poker UML and ADT design plan.
Computer Science 111 Fundamentals of Programming I More Data Modeling.
Unified Modeling Language, Version 2.0
Guide to Programming with Python
Two Way Tables Venn Diagrams Probability. Learning Targets 1. I can use a Venn diagram to model a chance process involving two events. 2. I can use the.
Understanding Objects and Classes
ניתוח מערכות מידע 1 Unified Modeling Language (UML) § § The Unified Modeling Language (UML) is the industry-standard language for: Specifying, Visualizing,
CSC172 Class Design Pepper. Goals How to design classes How to think in terms of objects StarUML Code Generation.
5th Grade Math Tuesday, April 22, 2014
CSC480 Class Design Pepper. Goals How to design classes StarUML Code Generation.
 m C r =m!/r!(m-r)!  Property: m C r = m C (m-r)  Example: ◦ If you have 10 pens, all in different colors, and you want to bring two of them to class,
November 28, 2005ICP: Chapter 9: Object Oriented Programming 1 Introduction to Computer Programming Chapter 9: Object Oriented Programming Michael Scherger.
CMSC 202 A Design Exercise. 2 OO design activities Finding the Objects Defining the responsibilities –Services –Attributes Discovering relationships.
California has 5 water year types: 1 card = 1 water year Critically dry and dry years: Ace-10 black cards Normal-wet years: all red cards & all face cards.
Games We Play By James Ramdeo 8.2 STEM Club. Factors and Multiples is a game that can be played against one of friends. In this game you start with any.
If a dice is rolled once, what is the probability that it will show an even number?
Card Game Z  Agree on a dealer and a score keeper  The dealer should remove all the Jacks, Queens, Kings & Jokers from the pack and then shuffle  The.
This computer science resource was developed through a collaboration between IBM Corporation and CSTA. 1 Lesson 2: Pong Class Design.
This computer science resource was developed through a collaboration between IBM Corporation and CSTA. 1 Lesson 1: Introduction to Pong.
Star UML and CRC Cards Pepper.
CRC Cards: Overview Emerson Murphy-Hill Creative Commons Attribution 4.0 License. Material Produced by NCSU Software Engineering Faculty.
Design and UML Class Diagrams
Introduction to Discrete Probability
TCSS 305 (Stepp) OO Design with UML Class Diagrams
Reaction Time and Neural Circuitry
Ionic Poker.
Object-Oriented Analysis (OOA)
Chapter 5 Black Jack.
6.NS.5 Integer War You will need: deck of cards
Lecture on Design Phase and UML Class Diagrams
Created by Meredith Roe Virtual School Program Manager,
Term Project: Poker Game
Task 2 Implementation help

CSCI 130 Classes and Objects.
-5*6= -6*(-8)= 2*(-16)= 54*4= Agenda Ticket in the Door
Do Now 9/24/10 Take out HW from last night. Copy HW in your planner.
I have… I have… Who has 3:40? Who has 12:20? I have… I have…
Presentation transcript:

Object Oriented Design

Object-Oriented Design Method for designing computer programs –Useful for thinking about large problems Consider “objects” interacting in the program –Example: a zoo, a gradebook

Objects Objects have state – what they know Objects have behaviors – what they can do Example: Car

Classes A programming construct to define the state and behaviors of a particular type of object –A class is the blueprint –An object is an instance of the class

CRC Cards Class, Responsibilities, Collaborators (CRC) The CRC card method is a mechanism for discovering the classes that will be part of a program.

Example: A Card Game Classes: Card, Deck, Hand, Dealer Class: Card –Responsibilities: Display self Report suit Report rank –Collaborators None

Example: A Card Game Classes: Card, Deck, Hand, Dealer Class: Deck –Responsibilities: Shuffle Deal Report size –Collaborators Contains cards

Exercises 1.Form groups of 2 or 3 and use the CRC method to design a coffee machine. Start with a coffee machine that can dispense black coffee or coffee with cream. Each costs 1.00.