© 2006 Pearson Education C4 D7 Obj: to describe relationships between objects HW: p.250 #4.19 Do Now: p.248 True/False #4.6 – 4.10.

Slides:



Advertisements
Similar presentations
Describing data Mean Median Mode Range.
Advertisements

Books. The cover of a book gives us information about it… The picture The title The author.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Lab 10: Bank Account II Transaction List, error checking & aggregation.
Java Software Solutions
Chapter 4: Writing Classes. 2 Objects  An object has: state - descriptive characteristics behaviors - what it can do (or what can be done to it)  For.
Chapter 4: Writing Classes
© 2006 Pearson Education Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition by John Lewis,
Chapter 3, More on Classes & Methods Clark Savage Turner, J.D., Ph.D. Copyright 2003 CSTurner, from notes and text.
Writing Classes in Java
Chapter 6 Object-Oriented Design. 6-2 Program Development The creation of software involves four basic activities:  establishing the requirements  creating.
Chapter 4: Writing Classes Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William Loftus.
Chapter 6 Object-Oriented Design. © 2004 Pearson Addison-Wesley. All rights reserved6-2 Object-Oriented Design Now we can extend our discussion of the.
ECE122 L16: Class Relationships April 3, 2007 ECE 122 Engineering Problem Solving with Java Lecture 16 Class Relationships.
COMP 14: decomposition, overloading, relationships June 7, 2000 Nick Vallidis.
Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science by John Lewis, William Loftus, and Cara Cocking Java.
1 (c) elsaddik CSI 1102 Introduction to Software Design Prof. Dr.-Ing. Abdulmotaleb El Saddik University of Ottawa (SITE.
Introduction to UML Lian Yu Department of Computer Science and Engineering Arizona State University Tempe, AZ
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Object Oriented Design and UML
The this Reference The this reference, used inside a method, refers to the object through which the method is being executed Suppose the this reference.
CSE 1301 Lecture 11 Object Oriented Programming Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Chapter 6 Object-Oriented Design. © 2004 Pearson Addison-Wesley. All rights reserved6-2 Object-Oriented Design Now we can extend our discussion of the.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
CSE 1302 Lecture 7 Object Oriented Programming Review Richard Gesick.
© 2006 Pearson Education 1 Obj: to use compound Boolean statements HW: p.184 True/False #1 – 6 (skip 3)  Do Now: 1.Test your “Charge Account Statement”
© 2006 Pearson Education Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition by John Lewis,
Chapter 6 Object-Oriented Design Part 1. © 2004 Pearson Addison-Wesley. All rights reserved2/42 Object-Oriented Design Now we can extend our discussion.
1 Object Oriented Design and UML Class Relationships –Dependency –Aggregation –Inheritance Reading for this Lecture: L&L 6.4 – 6.5.
© 2004 Pearson Addison-Wesley. All rights reserved November 7, 2007 Interfaces ComS 207: Programming I (in Java) Iowa State University, FALL 2007 Instructor:
9.5 Addition, Subtraction, and Complex Fractions Do Now: Obj: to add and subtract rational expressions Remember: you need a common denominator!
1 Object Oriented Design and UML Class Relationships –Dependency –Aggregation –Interfaces –Inheritance Interfaces Reading for this Lecture: L&L 6.4 – 6.5.
Chapter 6 Object-Oriented Design. © 2004 Pearson Addison-Wesley. All rights reserved6-2 Object-Oriented Design Now we can extend our discussion of the.
Static class members.
Object Oriented Analysis and Design Class and Object Diagrams.
© 2004 Pearson Addison-Wesley. All rights reserved September 14, 2007 Anatomy of a Method ComS 207: Programming I (in Java) Iowa State University, FALL.
CSE 1201 Object Oriented Programming Object Oriented Design.
© 2006 Pearson Education 1 Obj: to use assignment operators HW: Prelab Exercises 2 Quiz 3.1 – 3.4 in two class days  Do Now: 1.Read p.144 – 145 (3.4 “more.
1 Object-Oriented Design Now we can extend our discussion of the design of classes and objects Chapter 6 focuses on: software development activities determining.
By the end of this section, you will be able to: 1. Determine the LCM of polynomials 2. Add and subtract rational expressions Class notes from ___________.
Wednesday –POD –I have updated grades in powerschool. If you have a zero for a lab grade, it probably means you didn’t DropItToMe. Please do so. –Slides.
1 Object-Oriented Design Now we can extend our discussion of the design of classes and objects Chapter 6 focuses on: software development activities determining.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Chapter 4: Writing Classes. 2 b We've been using predefined classes. Now we will learn to write our own classes to define new objects b Chapter 4 focuses.
Source Page US:official&tbm=isch&tbnid=Mli6kxZ3HfiCRM:&imgrefurl=
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 4: Writing Classes Presentation slides for Java Software Solutions for AP* Computer Science.
Outline Software Development Activities Identifying Classes and Objects Static Variables and Methods Class Relationships Interfaces Enumerated Types Revisited.
1 Chapter 4: Writing Classes  Chapter 4 focuses on: class definitions encapsulation and Java modifiers method declaration, invocation, and parameter passing.
© 2004 Pearson Addison-Wesley. All rights reserved November 2, 2007 Class Relationships ComS 207: Programming I (in Java) Iowa State University, FALL 2007.
Путешествуй со мной и узнаешь, где я сегодня побывал.
Object-Oriented Design. Static Class Members Recall that a static method is one that can be invoked through its class name For example, the methods of.
University of Turkish Aeronautical Association Computer Engineering Department CENG 112 COMPUTER PROGRAMMING 2 Tansel Dökeroglu, Ph.D.
Chapter 4: Writing Classes
Interfaces November 6, 2006 ComS 207: Programming I (in Java)
Chapter 4: Writing Classes
©2004 by Pearson Education. ©2004 by Pearson Education.
©2004 by Pearson Education. ©2004 by Pearson Education.
Adding and Subtracting Rational Expressions
Page 1. Page 2 Page 3 Page 4 Page 5 Page 6 Page 7.
Object Oriented Programming
Object Oriented Programming
Address Book App Android How to Program
Review for the Final Exam
Turn to page 26. Read the Conclusion
Object Oriented Programming Review
Probability distributions
Chapter 4: Writing Classes
Presentation transcript:

© 2006 Pearson Education C4 D7 Obj: to describe relationships between objects HW: p.250 #4.19 Do Now: p.248 True/False #4.6 – 4.10

© 2006 Pearson Education Object Relationships  Objects can have various types of relationships to each other  A general association is sometimes referred to as a use relationship  A general association indicates that one object (or class) uses or refers to another object (or class) in some way Author Book writes

© 2006 Pearson Education Object Relationships  Some use associations occur between objects of the same class  For example, we might add two Rational number objects together as follows: r3 = r1.add(r2);  One object ( r1 ) is executing the method and another ( r2 ) is passed as a parameter  See RationalNumbers.java (page 229)RationalNumbers.java  See Rational.java (page 231)Rational.java

© 2006 Pearson Education Aggregation  An aggregate object is an object that contains references to other objects  For example, an Account object contains a reference to a String object (the owner's name)  An aggregate object represents a has-a relationship  A bank account has a name  Likewise, a student may have one or more addresses  See StudentBody.java (page 235)StudentBody.java  See Student.java (page 236)Student.java  See Address.java (page 237)Address.java

© 2006 Pearson Education  Begin p.251 #4.3 (it’s under “Programming Projects” but we will count it as a lab). Call it RollDice.java  The Die class is listed on p.222 in your textbook, you should reference this class in your program.