Question
A class named watch that meets the following requirements: The class has three variables: hours (type int), minutes (type int), and seconds (type int). The
A class named watch that meets the following requirements: The class has three variables: hours (type int), minutes (type int), and seconds (type int). The class has a parameterized constructor that takes three parameters. The constructor constructs a Clock with the specified time values. A method named updateTime with one argument (totalSecs). It increases the time of the watch by passing total number of seconds, however all parameters should be updated after rounding as follows hours = totalSecs / 3600; minutes = (totalSecs % 3600) / 60; seconds = totalSecs % 60; you can use Math.round(value) for rounding
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started