The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
With C++, Create a class that simulates an alarm clock. In this class you should:
ï‚· Store time in hours, minutes, and seconds. Note if time is AM or PM. (Hint: You should have separate private members for the alarm and the clock. Do not forget to have a character variable representing AM or PM.)
ï‚· Initialize the clock to a specified time.
ï‚· Allow the clock to increment to the next second. (Hint: You need to take into account thingslike if the clock"s time is 11:59:59 AM and you increment by a second, the time will be12:00:00 PM. You may need to consider some iterated if statements.)
ï‚· Set the alarm and have the alarm print out "WAKE UP" when the set time is reached. (Hint: You may wish to create a private function that provides the wished-for printout when the alarm time is reached and the alarm clock is on.)
ï‚· Display the present time.
ï‚· Use the class in a program that uses the functions requiring displaying of time and setting of the alarm.
Â
Include 2 constructors. One constructor should be the default constructor that will initialize the object to 12:00:00 AM. The second constructor should take parameters for hours, minutes, seconds, and AM/PM. Both constructors will provide the private members with the time. In addition, have both constructors set the alarm clock as off. (You will need a Boolean variable that determines whether the alarm is on or off). The function or method you use to set the alarm will set the alarm on.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll