Designing a Card Game Solitaire--Thirteens. Game.

Slides:



Advertisements
Similar presentations
Engr 691 Special Topics in Engineering Science Software Architecture Spring Semester 2004 Lecture Notes.
Advertisements

Classes and Objects. What is Design? The parts of the software including – what information each part holds – what things each part can do – how the various.
For(int i = 1; i
Based on Java Software Development, 5th Ed. By Lewis &Loftus
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14: More About Classes.
Copyright © 2012 Pearson Education, Inc. Chapter 14: More About Classes.
Objects, Variables & Methods Java encapsulates data and action modules that access the data in one container, called an object. Object members that.
Elevens Lab Student Material – on website
1. 2 Introduction to Methods  Method Calls  Parameters  Return Type  Method Overloading  Accessor & Mutator Methods  Student Class: Revisited.
Objects. Strings String x = “abc”; String is a class, not a primitive x.charAt(2) is ‘b’ use name and ‘.’ and name.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
1. 2 Introduction to Classes  Motivation  Class Components  Instance Variables  Constructors  The Student Class  Exercises.
Exercise Exercise Exercise Exercise
Exercise Exercise Exercise Exercise
CS 106 Introduction to Computer Science I 11 / 19 / 2007 Instructor: Michael Eckmann.
AP Computer Science.  Not necessary but good programming practice in Java  When you override a super class method notation.
Understanding class definitions Looking inside classes.
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.
CSS446 Spring 2014 Nan Wang.  To learn how to choose appropriate classes for a given problem  To understand the concept of cohesion  To minimize dependencies.
UML Basics & Access Modifier
ITP © Ron Poet Lecture 13 1 Helper Objects. ITP © Ron Poet Lecture 13 2 Console Helper Object  We have used Console objects for a while, let’s see what.
Packages. Package A package is a set of related classes Syntax to put a class into a package: package ; public class { …} Two rules:  A package declaration.
More on Classes Pepper With help from rs.html.
Computer Science 111 Fundamentals of Programming I More Data Modeling.
Object Oriented Design: Identifying Objects
Creating Simple Classes. Outline of Class Account Class Account Account # Balance Holder name phone# Overdrawn (true/false) Data Members Open Credit Debit.
ACO 101: Introduction to Computer Science Anatomy Part 2: Methods.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
© 2004 Pearson Addison-Wesley. All rights reserved September 14, 2007 Anatomy of a Method ComS 207: Programming I (in Java) Iowa State University, FALL.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
© 2007 Lawrenceville Press Slide 1 Chapter 8 Objects  A variable of a data type that is a class. Also called an instance of a class.  Stores data  Can.
Static. 2 Objectives Introduce static keyword –examine syntax –describe common uses.
Copyright by Scott GrissomCh 2 Class Definition Slide 1 Class Structure public class BankAccount{ fields constructor(s) methods } Sample Code Ticket Machine.
FINANCIAL MANAGEMENT GUIDE © Marin Management, Inc General Accounting Procedures, 7143 Company Credit Cards A. The Purpose of This Policy The.
CS1054: Lecture 11 More Sophisticated Behavior (contd..)
Bank Account Example public class BankAccount { private double balance; public static int totalAccounts = 0; public BankAccount() { balance = 0; totalAccounts++;
Defining Classes I Part B. Information hiding & encapsulation separate how to use the class from the implementation details separate how to use the class.
Non-Static Classes What is the Object of this lecture?
Lecture 3: More on Classes Textbook: Chapter 2 Recap: –Classes vs. Objects –Q: What comes first a class or an object? –Q: Do we need a class to create.
1 Advanced Object Oriented Systems (CM0318) Introductory Lecture (Last modified: 28th January 2002)
Spin for Expressions Materials: – Plus/minus spinner – A number cube – Expression playing cards Pass out all the expression cards FACE DOWN. The dealer.
PRG 420 Entire Course FOR MORE CLASSES VISIT PRG 420 Week 1 Individual Assignment Hello world PRG 420 Week 2 Individual Assignment.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
INTRODUCTION TO CLASSES & OBJECTS CREATING CLASSES USING C#
LOGO Организация кредитования в Республике Беларусь Костенко А.К., к.э.н., доцент.
© A+ Computer Science - Elevens is a lab about classes and Lists. List is a major concept being tested by the Elevens lab. Elevens.
涉外合同中的法律适用问题 --- 以上海地区为例 Group 2 吕雅丽 王燕玉 刘彧 孙煜 韦卫玲 李天奇 LOGO.
AP Java Elevens Lab.
Re-Intro to Object Oriented Programming
Examples of Classes & Objects
Intro To Classes Review
Creating Your OwnClasses
PRG 421 Week 1 Individual: Week One Coding Assignment--
Methods The real power of an object-oriented programming language takes place when you start to manipulate objects. A method defines an action that allows.
Introduction to Classes and Objects
public class BankAccount{
Ch 4: Writing Classes Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: Classes and Objects.
Classes & Objects: Examples
More on Classes and Objects
Exercise Design a Design Class for: Vehicle (for a car dealership)
The University of Texas – Pan American
Class Everything if Java is in a class. The class has a constructor that creates the object. public class ClassName private Field data (instance variables)
Which best describes the relationship between classes and objects?
Agenda About Homework for BPJ lesson 15 Overloading constructor
Classes and Objects CGS3416 Spring 2019.
I have… I have… Who has 3:40? Who has 12:20? I have… I have…
CSC 205 Java Programming II
Day 11 The Last Week!.
Presentation transcript:

Designing a Card Game Solitaire--Thirteens

Game

Objects Needed to play cards?

Class Design for Card Instance Variables (at the top of the class & private!): Constructor Methods: accessors & modifiers private ______________________; private ___________ ____________; private String suit; private int pointValue;

Exercise 1: Download CreditCard.zip You are working for American Express. They need to develop credit card processing software. Create a class CreditCard that represents a credit card account. 1 private instance variable 1 constructor 3 methods Exercise 2: Download flower_project_draft.zip You are a designer and need to create a logo for a company. Write a class that describes a flower. 2 instance variables 1 constructor 1 method (draw()) Exercise 3: Optional Download InchWorm.zip