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

  Creating modular program to enter monthly costs

Create a modular program which asks the user to enter monthly costs for expenses given incurred from operating his or her automobile.

  How an object would be instantiated using both types

explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of cons..

  Advantages and disadvantages of grassroots computing

Discuss how grassroots computing changes the way software is designed, developed, tested, and maintained in a typical organization. What are the advantages and disadvantages of grassroots computing?

  Use a single if statement and boolean operators

Write a program that asks the user for a year and computes whether that year is a leap year. Use a single if statement and Boolean operators.

  Using jflap construct a turing machine

Using JFLAP construct a turing machine that does integer division for numbers in unary notation. For example your machine should execute the calculation

  Voluntarily gravitating to give up our real world experience

In an age of virtual worlds where people are spending inordinate amounts. Are we voluntarily gravitating to this world and giving up our real world experiences for virtual ones?

  Systems analyst modifying the sales order process

Suppose that you are a systems analyst on a project that involves modifying the sales order process. How many do you need to sample if you want 95 percent certainty that you have covered all variations?

  Write a pseudocode statement

Write a pseudocode statement that subtracts the variable downPayment from the variable total and assigns the result to the variable due. Don't use integer as decimal places will be needed.

  Explore and estimate software programs

Explore and estimate software programs based on following criteria: Needs assessment -- Why would the prospective user require program? Write down the features of the program?

  What frequency of radio waves corresponds to wavelength

Radio amateurs are allowed to communicate on "10 meter band." What frequency of radio waves corresponds to wavelength of 20m?

  Perform the usual operations on circle

You should be able to perform the usual operations on the circle, such as setting the radius, printing the radius, calculating and printing the area and circumference.

  Classify occurrences as an incident or disaster

Classify each of the following occurrences as an incident or disaster. If an occurrence is a disaster, determine whether or not business continuity plans would be called into play.

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