Create a class that simulates an alarm clock

Assignment Help Basic Computer Science
Reference no: EM13208150

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 repersenting am or pm) *initialize the clock to a specified time. *allow the clock to increment to the next second (you need to take into account things like if the clock's time is 11:59:59 AM and you increment by a second, the time will be 12:00:00 PM. You may need to consider some iterated if statements.) *set the alarm and have the alarm print "Wake Up" when the set time is reached. (you may wish to create a private function that provides the wished-for print out 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.

Reference no: EM13208150

Questions Cloud

Why farmers may be better-off when harvests are low : In order to reduce farm output, raise farm prices, and thus raise farm incomes (revenues), the government pays farmers to set aside a portion of their land from production. Using a graph, explain in terms of the elasticity of demand for farm produ..
Compute the mass of the particle in kilograms : a particle has a velocity equal to 0.25 c and a wavelength of 1.3 x 10^-16 m. Calculate the mass of the particle in kilograms. c=3.0 x 10^8 m/s
Prepare a statement of cash flows : Prepare a statement of cash flows (indirect method) for the year ended December 31, Year 2 and prepare a side-by-side comparative statement contrasting two bases of reporting: (1) net income and (2) cash flows from operations.
Write the function xsort which takes in a list of strings : Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex'] th..
Create a class that simulates an alarm clock : 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.
What is the opportunity cost for maria to cut logs : maria and emmanuel need to cut logs for shelter or gather food to stay alive per day. maria produces 10 cut logs of shelter and 10 baskets of food. emmanuel produces 5 cut logs of shelter and 8 baskets of food. a) what is the opportunity cost for m..
Design a module : Design a module, using pseudocode, named getNumber, which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference paramter variable.
Compute the moles of oxygen gas produced : calculate the moles of oxygen gas produced fro 4.40mol H2O2. 2H2O2(i) ---->2H2(g) + O2(g) Express your answer with the appropriate.
Find the expected total number of skiers at the two ski area : Resort A and Resort B are two ski areas. On any randomly selected day during the ski season, the expected number of skiers purchasing lift tickets at Resort A is 6,000, with a standard deviation 2,000. The number of skiers purchasing lift tickets ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Implement new forms of computer-mediated technology

How would implementing new forms of computer-mediated technology influence your organization's communication? What is the significane of managers selecting suitable channel for message distribution in Information Age?

  Expalining protocols essential in data communications

What is meant by protocol? Why are protocols essential in data communications?

  Describe how to recover file for further investigation

When you try to open file in image viewer, message is displayed indicating that file is corrupt. Write 2-3 page report describing how to recover the file, orkty.zip, for further investigation.

  Explain legal reasons for not performing examination

Legal reasons for not performing examination on suspect's computer, but sometimes you have to compromise. If we make compromise, is it acceptable by court?

  The text files boynames.txt

The text files boynames.txt and girlnames.txt contain a list of the 1,000 most popular boy and girl names in the U.S. for the year 2003 as compiled by the Social Security Administration.

  Design a class named checkingaccount

Design a class named CheckingAccount that holds a checking account number, name of the account holder, and balance.include methods to set values for each data field and a method that displays all the account information. Create the class diagram a..

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Write z schemas defining state of the system card validation

Write Z schemas defining the state of the system, card validation (where the user's identifier is checked) and cash withdrawal.

  Write the communication in the neuron work

Write down the communication within the neuron work? Write down the communication between the neuron work?

  Did the city make the right decision to left town

Aabout 300,000 bills would have had to have been examined. Some residents left town, and the individual refunds were not that large. Did the city make the right decision?

  Policies and provisions to unbundled network elements

What are some of the major policies and provisions under the 1996 Act in regards to unbundled network elements (UNEs).

  Creating a payoff table for decision

Amy decided to select the best option which will minimize her total 36-month cost. Difficult is that Amy is not sure how many miles she will drive over next three years. Create payoff table for Amy's decision.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd