i want to know how to implement a CD class for a CD Store

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kaymo50
    New Member
    • Oct 2008
    • 2

    i want to know how to implement a CD class for a CD Store

    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"
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    There's no need for thinking anymore; your assignment text told it all.

    kind regards,

    Jos

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      Originally posted by JosAH
      There's no need for thinking anymore...
      ...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.)
      Also, you may want to check our Java Articles Section.

      Greetings,
      Nepomuk

      Comment

      Working...