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

  Explain remote batch-processing operation

A band is always equal to? In signal power as light travels down fiber is called. what does remote batch-processing operation in which data is only input to central computer would need?

  Hardware and system software qualify as infrastructure

What is infrastructure? In what was do hardware and system software qualify as infrastructure? What basic strategic planning questions should be addressed with respect to infrastructure?

  Explain type to reveal computer to be computer

Explain why you think these questions would be the type to "reveal" the computer to be a computer? Why would these responses have to be given a human begin?

  Shortest path between each pair of nodes using floyd''s metho

find the shortest path between each pair of nodes using Floyd's method

  Information assets to estimate for risk management

If organization has three information assets to estimate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first?

  Make an instance of romannumerals

Make an instance of RomanNumerals and invoke the method toRoman(int n). Enter a number in the Arabic notation and it will convert it to a Roman numeral. For example 17 will be converted to XVII.You will notice a test suite that we provide with the..

  Explaining drain corporate budgets and ultimately profits

First of all it eliminates requirement of hardware, downloads and implementations which drain corporate budgets and ultimately profits. It takes companies only a third of the expenses that they will incurred to have their companies running.

  Find how many times will keyboard be checked in an hour

Assume the processor scans keyboard every 100 ms. How many times will keyboard be checked in the 8-hour period?

  Describe constraints which encode that cell is observed

Describe constraints which encode that cell (1, 2) is observed and indicates mine is not present, that cell (2, 1) is observed and indicates a mine is present, and that remaining cells are unobserved.

  Program to keep track of the participants in a triathlon

Create a program to keep track of the participants in a triathlon. Your program will keep track of the times in three events: Running, Swimming, and Biking. Your program will calculate who is the winner in the Male category and the Female category..

  What is the relationship between transistor densities

In two paragraphs explain what is the relationship between transistor densities and the improvement in computer speed and miniaturization?

  Computing conditional probability

Pprocessor failed sometime in the interval [4; 8] years. Given this information, what is the conditional probability that it failed before it was 5 years old?

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