Create a class that simulates an alarm clock

Assignment Help Basic Computer Science
Reference no: EM13232923

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

Questions Cloud

Explain why is the presence of non-atomic species : why is the presence of non-atomic species, such as metal oxides, detrimental to an analysis using atomic spectroscopy. which type(s) of atomizers can suffer from this effect and why.
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.
Explain the fatty acids : You decide to study fatty acid metabolism in cells that areactively synthesizing fatty acids. For your experiments, you have a number of tracer molecules labeled with carbon-14
Explain astronaut''s energy comes from burning glucose : assume that an astronaut's energy comes from burning glucose(c6h12o6). write 3 equations (including delta H values that represent the heats of formation for each C6H12O6, H20 and CO2.
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.
Explain reactions carried out at a constant temperature : Consider the following reactions carried out at a constant temperature and pressure. In which of these will the amount of work done be positive, only the coefficients of the reactants are given. All species are gas unless otherwise noted.
Why brownstowns management was reluctant to release info : A combination of low prices with strong competition by foreign competitors and so-called "legacy costs" of unions are cited as the primary reasons why so many steel companies are filing for bankruptcy. In 2002, as Brownstown Steel Corp.
What changes to each products price should domino sugar make : Domino Sugar Is considering the purchase of Fisher Honey Co. for $100 million. Based on information obtained from 500 supermarkets around the country, when 1 lb. of Domino Sugar went o sale from $2.00 to $1.50,
State the structures of the organic products : Write the structures of the organic products that will be formed when methyl benzoate is treated with lithium aluminum hydride and the reaction mixture is worked up with aqueous acid.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Program that reads a file of computer data names computers

write a program that reads a file of computer data names computers.txt. creates an array of Computer objects.

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Cloud provider secure large amount of capital

Few organizations tend to prefer operating expense models. whether Cloud providers will continue to secure large amount of capital....or will equity firms stop their funding?

  Create a sequentially numbered array

Create a sequentially numbered array of 50 integers. Then use the Random_range procedure to shuffle the array in a random order.(Each number will only appear once in the array.) Display the shuffled array.

  Determine companies which specialize in computer forensics

What needs clarified? it's plainly stated use google to find 3 companies which specialize in computer forensics of those 3 companies write 2 or 3 paragraphs comparing what each company does.

  Conduct observation used in business or organization

Conduct the observation to someone involved in procedure which is used in the business or organization. This person could be someone at university.

  Write a program that accepts a temperature

Write a program that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values. Save the class as FahrenheitToCelsius.java.

  How long will it take to reach steady-state value

Investigate the effect of the parameter b on y(t). To do this, plot y versus t for several values of b on the same plot. How long will it take for y(t) to reach 98 percent of its steady-state value?

  What rc key value leave state vector during initialization

What RC4 key value will leave state vector, S unchanged during initialization? That is after the initial permutation of S, the entries of S will be equal to the values.

  Method named printgrid

Write a method named printGrid that accepts two integer parameters rows and cols. The output is a comma-separated grid of numbers where the first parameter (rows) represents the number of rows of the grid and the second parameter (cols) represents th..

  Create application that lets user select two primary colors

when the user clicks mix button,the form's background should change to the color that you get when you mix the two selected primary colors. note: i want the solution in visual c# not in c++ plz

  Function whose job is to input

Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read. A. unsigned readA();

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