A07

Due Date: Friday, November 3
File(s) to be submitted: MusicTrack.java
Sample Output: SampleOutput.html
Starter Files:


SUBMIT   /   Check

MusicTrack (objects with constructors, getters, and setters)

Summary

We are creating a non-program class this week. The MusicTrack class keeps track of the list of music tracks, as the name suggests!

I have provided a tester program. Do not change the tester program except by deleting the lines labeled DELETE THIS LINE when .... If you change the program code, then your MusicTrack class code probably won't work the way we want it to.

Exception: You are allowed to change the package name or delete the package a07; command completely.

The tester program tests the MusicTrack class bit by bit. You should make sure that each bit is completely correct before you move on to the next bit. Create the methods in the order TestMusicTrack uses.

Note for those with computer programming experience. We know that having the constructors and setters print error messages is not best practice. But we want you to do it anyway. We are not going to cover throwing and catching exceptions until next term (CSCI 1228), so we can't expect beginners to know how to do that. So if you do throw exceptions, our testing programs won't work, and you will get a bad grade.

Also, we want you to print the error messages to System.out instead of System.err. For similar reasons.

Details

MusicTrack objects have four instance variables, namely artist, title, length and downloadCount.

This class also has the following public methods:

Grading Outline


SUBMIT   /   Check