Question: Write a class TrackListException that extends Exception with the following constructors: A default constructor that gives the error message Too many tracks. A constructor that
Write a class TrackListException that extends Exception with the following constructors: A default constructor that gives the error message "Too many tracks." A constructor that takes a string and uses this for the error message Part II Write a class AudioDisk with the following attributes: Two instance variables (with corresponding getters and setters): name - a String for the name of the audio disk. tracks - an array of Strings with length 5, holding the names of the tracks the disk holds. A default constructor that initializes name to be "NoName." A constructor that takes a String to set the name of the disk Two methods: assignTracks (no input parameters or return values) - This method should ask a user to from the console window until the user enters an empty line, which indicates the end of the user enters more than 5 tracks, throw a TrackListException writeDiskInfo (no input parameters or return values) - writes the name of the disk and the disk's tracks to the console window. Part III Write a class AudioCd, a subclass of AudioDisk, for disks which can hold at most 2 tracks. The include the following: A default constructor that invokes the superclass constructor A constructor that takes a String to set the name of the disk. An overridden assignTracks that throw s a TrackListException when a user tries to assign tracks to an AudioCd. Part IV Write a class TestDisk that does the following: 1. Creates a Disk with the model The Arcade Fire 2. Assigns some tracks to the disk The Arcade Fire 3. Writes the information about The Arcade Fire to the console window 4. Creates a AudioCd with the name Man Man 5. Assigns tracks to Man Man 6. Writes the information about the Man Man to the console Finally Submit all 4 source files to the dropbox
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
