Create a class that simulates an alarm clock

Assignment Help Programming Languages
Reference no: EM13936350

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 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 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.

Reference no: EM13936350

Questions Cloud

How can a uk company use regression analysis : How can a UK company use regression analysis to assess its economic exposure to fluctuations in the euro? What is the purpose of breaking the database into sub-periods?
What is the maximum inventory level : If they wish to produce this product in economic batches, what size batch should be used? What is the maximum inventory level? How many order cycles are there per year? How much does management of this good in inventory cost the firm each year?
Define a class called revenue that has 2 private members : Use public functions of the class in a program that computes RevenueValue and displays RevenueValue when demand is 2000 and price is 2.
Ehealth software solutions : eHealth Software Solutions is a medium-sized company of 110 employees, with an impressive record for producing innovative healthcare software solutions for the health industry, including doctors' practices and small to medium sized medical clinics..
Create a class that simulates an alarm clock : 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.)
How costs revenue and earnings items would be affected : determine how the costs, revenue, and earnings items would be affected by three possible exchange rate scenarios for the New Zealand dollar.
Define and create an exception : Quotient throws an exception to the higher-level function main to decide whether or not the program should be terminated. Main catches the divByZero and prints out an appropriate comment on the screen. Also include in main a try block to catch the..
Religious and spiritual systems of belief : Compare and Contrast: Religious and Spiritual Systems of Belief, This question is fairly open ended in order to shed light into an important methodology in cultural anthropology: comparative methods
Marketing as an exchange process : Your report is to produce an interesting article based on your organisation, with up to three visual illustrations if appropriate. Different sections of the article should cover: marketing as an exchange process, a philosophy of business, and a ma..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that inputs two numbers

Write a program that inputs two (2) numbers and determines which of the two numbers is the smallest. If the numbers are equal, display a message that they are equal

  Write program to initializes array with ten random integers

Write a program which initializes the array with ten random integers and then prints four lines of output, containing: - Every element at an even index.

  Programming problem

Programming Problem can be solved by a program that performs three basic tasks-Input Data, Process Data, and Output Results.

  Calculate and print the annual salary of the employee

Calculate and print the annual salary of the employee. suppose employee receive 6% increase in pay. Calculate and print net pay giving the pay rate and hours work. Suppose deductions amount to 9% of the gross pay.

  Write a class named car that has the member variables

Write a class named Car that has the following member variables: YearModel. An int that holds the car's year model

  Write function which take parameter-string and returns vowel

Write function which takes as parameter and string and returns the vowels (a, e, i, o, u). Function prototype should look like: void countVowels(string str, int& aCt, int& eCt, int& iCt, int& oCt, int& uCt);

  Deisgn child class that overrides parent method

Deisgn child class named Box, that contains additional data field named depth and a computeSurfaceArea() method that overrides the parent method appropriately for a three-dimensional box

  Program to checks to see if the value of a is valid

Checks to see if the value of a is 0; if it is, the code prints the message "no solution for a=0" and returns from the function.

  List comprehension to return a list of all the numbers

Write a higher order function list To that takes a function f and a number n and uses list comprehension to return a list of all the numbers from 1 to n for which the function fevaluates to True.

  Initialize elements of array with even integers

declare an array called values of type unsigned int with 5 elements. Initialize the elements of the array with the even integers from 2 to 10.

  Develop a program to determine the final scores

In this project, you will develop a program to determine the final scores, letter grades, and rankings of all students in a course. All records of the course will be stored in an input file, and a record of each student will include the first name..

  Choose one 1 of the working groups in the ietf or ieee and

write a three to four 3-4 page paper in which youquestion 1. select one 1 of the working groups in the ietf or

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