Create a class that simulates an alarm clock

Assignment Help Basic Computer Science
Reference no: EM13208109

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: EM13208109

Questions Cloud

Which search engine do you believe provided : Which search engine do you believe provided you the best results? Support your position by explaining why you believe the particular search engine to be better based upon your experience.
Explain over what wavelength range is the emission of light : Over what (approximate) wavelength range is the emission of light from excited sodium atoms most sensitive to the eye
Write a program that reads from the external file : write a program that reads from the external file input.txt, counts the letters in every word , replaces the word by that number and then writes the numbers to an external file output.txt
Decide whether or not sunny should undertake the investment : Prepare supporting calculations to decide whether or not Sunny should undertake the investment in the theme park given a risk adjusted discount rate of 11.80% per annum.
Create a class that simulates an alarm clock : 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.
Find who loses and who benefits from the policy : Suppose that the stock market crashes and, as a result, people in Gotham City are poorer. This reduces the quantity of taxi rides demanded by 6 million rides per year at any given price. What effect will the mayor's new policy have now
Which of the following is true : Which of the following is true? a. A program can call, at most, one method. b. A program can contain a method that calls another method. c. A method can contain one or more other methods. d. All of these are true
Explain how many moles of hydrogen are present sample : How many moles of hydrogen are present in a 26.3 mL sample at 19 degrees celsius and 744 torr?
Explain reasons for consulting different kinds of sources : Explain reasons for consulting different kinds of sources on the same subject.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  College or organization is considering a new project

Suppose your college or organization is considering a new project that would involve developing an information system that would allow all employees and students/customers to access and maintain their own human

  Verify local police department-s findings on current case

Your computer investigation firm has been hired to verify local police department's findings on current case. Tension over the case is running high in the city.

  Website has a duty to be familiar with drug laws

Assume a foreign website sells drugs which are not approved by regulatory agencies for sale to citizens of another country. Do you believe that website has a duty to be familiar with drug laws throughout the world?

  Recognize each dependency by type using code

Recognize each dependency by type; write the two instructions involved; recognize which instruction is dependent; and name storage location involved.

  Explaining publication of material in foreign languages

Which of the given statements about publication of material in foreign languages is not right? it is competitive neccessity or it must be accurate.

  How assembly language program is created-debugged-editors

Explain how the assembly language program is created and debugged by using system tools like editors, assemblers.

  Signed-magnitude representations binary numbers in computers

Why do we require signed-and-magnitude representations of binary numbers in computers? Represent decimal values: -37, -54, and 56 in binary by using signed-and magnitude representation.

  Determine the value of the variables

Determine the value of each of the indicated variables after the following code executes. Assume that each integer occupies 4 bytes.

  Solve the following problems using linearity of expectation.

Solve the following problems using linearity of expectation. . (For each problem you will want to think about what the appropriate random variables should be and define them explicitly.)

  Laws and regulation in telecommunications field

Do you believe we require laws and regulation in telecommunications field at all? Why or why not?

  Explain kind of system real-time statistics

Permits customers to see real-time statistics like views and click-throughs about their current banner ads. Which kind of system will most efficiently give a solution.

  Procedure for checking suitcases for secret compartments

You are responsible for checking suitcases for secret compartments in which bulky items like jewelry might be hidden. Explain procedure you would follow to check for these compartments.

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