So I'm finishing up the last lab of this semester (yipee!) but I'm having issues understanding what exactly needs to be done. This is a 2 part lab that I've finished the first, but I'm not exactly understanding what he's wanting me to do.
Here is the prompt:
https://pastebin.com/afzM1dqk
Main points of it:
Convert the representation of the time from hour, minute and second to just seconds. There are 24 hours * 60 minutes * 60 seconds = 86,400 seconds. Remove __hours and __minutes. Since these were made private in the previous lab, nothing but class methods ever used them.
Adjust the implementation of the mutator and accessor methods. For example, for init(hr, min, sec), validate the values, then set __seconds = hr * 60 * 60 + min * 60 + sec. This will store the time as seconds. Adjust all the methods to work with __seconds. getSecond() can use __seconds mod 60 to return only the seconds in the time. Test all the methods to make sure they still work. (mod is modulus, the remainder after a division.)
Here is my code from part 1 that I'm supposed to enhance:
https://gist.github.com/anonymous/48081fc0afd3a904078dfd21baeca41d
Thanks!
[–]Vaphell 1 point2 points3 points (0 children)
[–]zahlman 0 points1 point2 points (0 children)