Assignment 1

I have included a zip file with the necessary files needed to complete the assignment. The Instructions are below as well.

PLEASE PROVIDE:
– Screenshot of code and output
– All of your .java files
– All of your .class files

Using the Time2.java and Time2Test.java files provided, it would be perfectly possible to represent the time internally as the total number of seconds since midnight rather than with the three integer values hour, minute, and second. Clients could use the same public methods and get the same results. Modify the Time2 class so that time is represented internally as seconds by replacing the instance variables hour, minute, and second with a single instance variable called totalSeconds, and then use Time2Test.java to test your modified Time2 class.  If your implementation is correct, the output of Time2Test should be the same as it was before you made any changes to Time2. 
Note that the three argument constructor calls setTime() which then calls the setters and thereby demonstrates, whenever the three argument constructor is called, that the setters all work.  Your solution should focus on changing setters and getters and should continue using them to get full credit for your work.
Be sure you read the lab submittal instructions to submit your lab properly.  If you dont submit your lab properly you wont get any credit for your work and you will not be allowed to resubmit your assignment.

You can leave a response, or trackback from your own site.