Computer Programming - Java

Computer Programming - Java - www.monash.edu.au...

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: www.monash.edu.au COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University pursuant to Part VB of the Copyright Act 1968 (the Act). The material in this communication may be subject to copyright under the Act. Any further reproduction or communication of this material by you may be the subject of copyright protection under the Act. Do not remove this notice. FIT1002 Computer Programming Module 11 Combining Multiple Classes: Worked Examples www.monash.edu.au Assumed Knowledge •Before the beginning of this lecture, students should be familiar with: – reference objects, their declaration and use – arrays of objects and primitive data types – the entire set of lecture notes up to this point Before the beginning of this lecture, students should have read over: www.monash.edu.au Objectives •By the end of this lecture, students should: – understand how to go from a problem specification to a combination of classes, their data-members and methods. Problem: How do we write a piece of software to manage your CDs? Make a simple database for managing your collection of CDs. Each CD has a title, a cost, a number of tracks and details of the artist. Artist details include a name, date of birth and country of birth. You can add CDs to your collection and remove them when you become disinterested in that music. As part of managing your collection you want to know how many CDs are in your collection and the total cost/worth of the CDs in your collection. What am I being asked to do? How do we write a piece of software to manage our CDs? Make a simple database for managing your collection of CDs. Each CD has a title, a cost, a number of tracks and details of the artist. Artist details include a name, age and country of birth. You can add CDs to your collection and remove them when you become disinterested in that music. As part of managing your collection you want to know how many CDs are in your collection and the total cost/worth of the CDs in your collection. •A database is a collection of records that can be searched and manipulated. An individual record often represents an object such as an animal in a zoo, a person in a telephone directory or a book in a library. • Records contain fields that specify the characteristics of objects such as a person’s name and telephone number or the title, author and call number of a library book. •Typically users can add and remove records from databases as well as change the contents of the fields each record contains. •Databases are prime candidates for object-oriented programs. String title : “Bad” Artist artist int numTracks: 10 double cost: $25.00 CD has — What is the main object in the specification?...
View Full Document

{[ snackBarMessage ]}

Page1 / 8

Computer Programming - Java - www.monash.edu.au...

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