The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 438 Weeks Ago, 2 Days Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
Consider a class Time that represents a time of day. It has attributes for the hour and minute. The hour value ranges from 0 to 23, where the range 0 to 11 represents a time before noon. The minute value ranges from 0 to 59.
a. Write a default constructor that initializes the time to 0 hours, 0 minutes.
b. Write a private method is Valid(hour, minute) that returns true if the given hour and minute values are in the appropriate range.
c. Write a method set Time(hour, minute) that sets the time if the given values are valid
d. Write another method set Time(hour, minute, is AM) that sets the time if the given values are valid. The given hour should be in the range 1 to 12. The parameter is Am is true if the time is an a.m. time and false otherwise.
Â
-----------