Design and implement a CD class for a CD Store. A CD has 4 instance variables: title (String), artist (String), price (double) and number of copies sold (int). It has a constructor which takes all 4 parameters (in the order specified). There is an accessor method for each instance variable, but no mutator methods. There is also a toString method which returns a String formatted "Album title. Artist $Price. Copies sold: #". For example "Hot August Night. Neil Diamond $16.50. Copies sold: 8"
i want to know how to implement a CD class for a CD Store
Collapse
X
-
...as long as you know how to write a class in java. Do you? If you don't, you should check the sun tutorials which are linked here. (There's also more on that page, so take your time.)Originally posted by JosAHThere's no need for thinking anymore...
Also, you may want to check our Java Articles Section.
Greetings,
NepomukComment
Comment