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

  Prepare a scada program for the given flowchar

This is a flowchart I need a scada program that monitors a traffic road - Prepare a scada program for the given flowchar.

  Logarithmic scale for the x- and y-axes

Graph the functions 8n, 4nlogn, 2n2, n3, and 2n using a logarithmic scale for the x- and y-axes.

  Write program to open the text file-reads its contents

Write down a program which opens the text file and reads its contents into the stack of characters. Program must then pop characters from stack and save them in second text file.

  Create a new project in your ide named exceptionhandler

Create a new project in your IDE named "ExceptionHandler." Write code to accept numbers as described above from the user. Your code should ensure that only numbers are accepted.

  Create class has constructor to reduce function of fraction

Create a class RationalNumber (fractions) with the following functionality: Has a constructor that prevents a 0 denominator in a fraction and calls the reduce function to simplify the fraction

  Test a program for summing

You are to implement and test a program for summing 1/x as x runs over all approximately eight million (23 fraction bits) single precision floating point numbers in the interval [1, 2). You are to do this on a server, PC (or Mac) of your choice..

  Design a flowchart or pseudocode

Design a flowchart or pseudocode for the following:A program that accepts a candy name (for example, "chocolate-covered blueberries"), price per pound, and number of pounds sold in the average month, and displays the item's data only if it is a be..

  Write a program for a calculator

Write a program for a Calculator that can do two operations, + and -. This calculator should be able to add or subtract two numbers of any size. You may use Recursion if you want.

  Payroll program for a company

Write complete PAYROLL program for a company in which each employee falls into one of 3 categories - Administrative, Factory Employee or Salesperson.

  Prepare the logic for a program which performs arithmetic

create the logic for a program that performs arithmetic functions. design the program to contain two numeric variables.

  Write a program to create three identical list

Write a program to create three identical list, list1, list2, and list3, of 5000 elements. The program then sorts list1using quick sort, list 2 using insertion sort.

  Write program compute salary by adding base tax

Compute by adding base tax for that salary range and product of percentage of excess and amount of salary over minimum salary for that range. Write a program which solves this problem.

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