Create a class that simulates an alarm clock

Assignment Help Basic Computer Science
Reference no: EM13233497

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

Questions Cloud

Manifesto of futurism : Using Friedrich von Bernhardi's Germany and the Next War and Filippo Marinetti's "Manifesto of Futurism," what is good about war according to the two authors.
A task which follows a set of established instructions : External rewards and punishments can work nicely for algorithmic tasks but they can be devastating for heuristic ones. Solving novel problems depends heavily on the intrinsic motivation principle of creativity.
What benefits can older employees lend to emerging sectors : As we evolve away from an industrial base to a more service-oriented economy, what benefits can older employees lend to emerging sectors? Younger employees?
What is the weight of the bananas in newtons : At an outdoor market, a bunch of bananas attached to the bottom of a vertical spring of force constant 16.0 N/m is set into oscillatory motion with an amplitude of 20.0 cm
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.
Letter concerning toleration : I am tasked with writing a reader response paper to John Locke's "Letter Concerning Toleration". I am supposed to cover the groups that go beyond Locke's doctrine of toleration (basically, who cannot be tolerated) and why.
Explain base added to reach the third equivalence point : A 128.2mL sample of 0.15M solution of H3PO4 is titrated with 0.18M NaOH. What volume of base must be added to reach the third equivalence point
How organizational profitability is affected by the scm : reasearch a company that uses supply chain management. look how their organizational profitability is affected by the SCM.
Describe how opec pricing actually evolved : OPEC is the economist's favorite cartel to study, partly because it had such a spectacular short-run success and partly because oligopoly theory could be used to predict how OPEC pricing actually evolved. Research some recent developments in petro..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is an object lock and which object have locks

What is an object's lock and which object's have locks?

  Explain why its difficult to support direct assess to files

explain why its difficult to support direct assess to files with variable length records. suggest a method for handling this type of file if direct access is required.

  Write a program that reads in a length in feet

Include a looop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. There are 0.3048 meters in a foot. 100 centimeters in a meter, and 12 inches in a foot.

  Set of strings of balanced parentheses

Show that the set of strings of balanced parentheses is not defined by any regular expression. Hint: The proof is similar to the proof for the language E above. Suppose that the set of balanced strings had a deterministic finite automaton of m states

  Write structured english for clyde-s narrative policies

Lasting more than one day, we permit hotel, taxi, and airfare, also meal allowances. Same times apply for meal expenses." Write down structured English for Clyde's narrative of reimbursement policies.

  We enhance a machine making all floating-point instructions

Suppose we enhance a machine making all floating-point instructions run five times faster. If the execution time of some benchmark before the floating-point enhancement is 10 seconds, what will the speedup be if half of the 10 seconds is spent exe..

  Create a new group called mygroup

Directions: As you complete each of the following steps, keep track of what occurs at each point, including what you type, the output given, and if you experience any errors.

  Which of the following command removes a job at the at queue

Which of the following command removes a job at the at queue? (Select two. Each answer is an independent solution) a. atq b. atrm c. at -d d. at -f e. at -l

  The centroid and the cluster

Problem 1.  For the following set of points, the initial centroid, and the cutoff distance of 4, do the following operations: 1) find the clusters; 2) update the centroid value; 3) find the distance between the centroid and the cluster, and update th..

  Why can i only see up to the index of this book

Why can I only see up to the index of this book? I understand it's a large book and you may only want to give the reader access to part of the book, but if it's read only until I get my book in the mail, why can't I see the whole book

  Optimizes processing large amounts of data

Businesses today are extremely reliant on large amounts of data for making intelligent business decisions. Likewise, the data warehouses are often structured in a manner that optimizes processing large amounts of data.

  Create the users for the sales organization unit

Explain how you would create the users for the sales organization unit and how you can set up work groups in this particular situation

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