lecture32-apr20 - 4/20/09 Lecture 32 Announcements...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
4/20/09 1 Lecture 32 Announcements • Assignment 7 – out tomorrow; due next Friday – last one • Topics of the day – More OO - modeling OOD Nomenclature relationship/ association between classes classname operations/methods UML style attributes class super/sub classes Dog bark (int n) sleep( ) eat ( ) breed name height weight gender Owner name address Phone_Number owns UML Model Example Customers Have and Use Bank Accounts Bank Account •ID# •Owner •balance •Put $ in •Take $ out •Check balance 1 N has Customer SSN: Address: •Open accts •Get loans Modeling Bank Accounts (OO) Is a member of 1 many Bank Account An object is a speci±c member of the class Class represents all bank accounts My checking account What are the common attributes of and behaviors associated with all bank accounts? Attributes: •Account # •Owners name •Balance Behaviors •Deposit $ •Withdraw $ •Check current balance Moms savings account Harrys checking account • Bank account attributes – Account number – Account owner’s name – Current balance • Instance/member Variables – accountNumber – ownersName – balance Object State • Bank account operations – deposit money – withdraw money – get the current balance • Functions (non static/member) – deposit – withdraw – getBalance Object Behaviour
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/20/09 2 ADT Operations Bank Account ADT (design) An abstract data type (ADT) is a high level description of a new data type to be implemented. The kind of objects and their common attributes and operations are described, in general. E.g. This is a definition of an abstract class of related bank account objects. Bank Account: a bank account is a holding place for $$ to be managed Common Attributes: balance - the current value in $$ in this account owner - the name of the person that this account belongs to account_ID - a unique number assigned by the bank that identifies this account Common Operations: deposit - updates the current balance by adding in a given amount post condition: the new balance is increased by the amount of $$
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/24/2010 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

Page1 / 5

lecture32-apr20 - 4/20/09 Lecture 32 Announcements...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online