Starting from:

$30

CPT120-Tutorial 9 Solved

a)  State the hypothetical name of your application. This would be your application class and you must state its name. E.g. MusicLibrary

b)  What other things need to be there be in the system that you have multiples of? These are your objects. E.g. array of songs in the

MusicLibrary

c)  Which of these objects would be of the same type? In IIE8 every song had a song title and a location and therefore every song in the song array came from the same Song class. List the classes that you have identified, in addition to the application class. E.g. Song

d). For each class above, specify what object member variables would be there. E.g. the Song class can have members String name, String location, int rating, int numberOfTimesPlayed so that every Song object will have a unique set of values for each of these variables. (Note: All member variables must be non-static explicitly private in Intro To Prog).

e)               From the member variables that you have identified in part d, which of these are mandatory when creating an object? In IIE8 we said that Song cannot be created without a title and a location (the other member variables such as rating and numberOfTimesPlayed are not that important to specify at the time of creating a Song object). These would be in your constructor’s parameters/arguments. For each class identified above, state the constructor’s parameters.

f)                State at least one other important method that must be there in the application that is not a simple get/set (accessor/mutator) method. E.g. a Song object has the getSongTitle method and the setSongTitle method but these are too obvious. Instead we are interested in methods like playSong or findSongs, etc.
Note: Even if you have not thought everything through, something planned in writing is better than just an idea in your head. Your answers to a-f need not be final but you must show effort in these

More products