// Arup Guha
// 3/22/06
// A solution for a COP 3330 in-class exercise on 3/21/06. This class
// inherits from MediaItem and defines a simple CD object.

import java.util.*;

public class CD extends MediaItem {

  private String title;
  
  // Initializes a CD object with values of the appropriate parameters.
  public CD(String singer, String album, int idnum, double price) {
    super(price, idnum, singer);
    title = album;
  }  

  // Returns a string that represents a CD object in a readable format.
  public String toString() {
    return ("Artist: "+author+" Title: "+title+" Sku: "+sku+" Cost: "+price);
  }

  // This method creates a CD based on the object it is called on. In 
  // particular, the new CD's artist name is the same. The title is the 
  // same as the original but has "II" appended to it. The cost is 2
  // dollars more than the original, and the sku is one more than the
  // original sku
  public CD makeSequel() {
    return (new CD(author, title+"II",sku+1,price+2));
  }

  // Returns a clone of the current object.
  public CD clone() {
    return new CD(author, title, sku, price);
  }

}
