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

  Write program that reads length and width of a rectangular

Write a program that reads in the length and width of a rectangular yard (in meters) and the length and width of a rectangular house (in meters) placed in the yard.

  Write a c++ program that read an integer

Write a C++ program that read an integer.The code will check if the number is divisible by 3, it will print the number is divisible by 3.

  Create implementation plan to analyze options

Boardman plans to hire Smith Systems Consulting to help them analyze their options and to create the implementation plan.

  Explaining negative reactions to pop-up and pop-behind

Many people have strong negative reactions to pop-up, pop-behind, interstitial, and rich media ads. Assume you are the director of an advertising agency that specializes in creating and placing these ads.

  Write the truth table for a device

The output should be in Binary Coded Decimal representation. 4. Use Full Adders and logic gates to design a device which will multiply a given 4-bit signed input x by -2.

  Suppose a c++ compiler for the mips

Suppose a C++ compiler for the MIPS machine associates $s5 with array a and $s6 with variable i. How does it translate a[i] = a[i+1]; into MIPS assembly language?

  Multiplexors whose control bit allows

Multiplexors whose control bit allows you to select between one of two modes right shift or left shift. Include logic to perform arithmetic shift left and arithmetic shift right . This means you must include logic to perform sign extension in ..

  Show the design of a modulo 7 asynchronous counter

Using positive edge triggered flip flops, show the design of a modulo 7 asynchronous counter that counts: 7,6...1,7, etc. You may assume that your flip flops have asynchronous Set and Reset inputs available. (Hint: Connect Q to the clock input of the..

  Mips uses word alignment

MIPS uses word alignment, so all words are stored in memory on word boundaries; this means that address bits A[1:0] are always 00. How many and which address bits would be allocated for the set index?

  Explain how objects are created in java

Explain how objects are created in Java and how the memory used by objects is recovered. Compare this to object creation and destruction in C++.

  Formulate the lp model to minimize weekly shipping cost

Formulate the LP model to minimize weekly shipping cost and formulate the LP model to minimize production and inventory costs and meet the demand for the next four months.

  Decision to utilize components influence requirements

Must RMO consider using purchased components in the new CSS? If so, When, must it begin looking for components? How will decision to utilize components influence requirements, design and implementation phases?

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