subject
Engineering, 06.10.2019 08:00 raemyiajackson1

My mother always took a little red counter to the grocery store . the counter wasused to keep tally of the amount of money she would have spent so far on that visitto the store if she bought everything in the basket. the counter had a four-digitdisplay, increment buttons for each digit, and a reset button. an overflow indicatorcame up red if more money was entered than the $99.99 it would register. (thiswas a long time ago.)write and implement the member functions of a class counter that simulates andslightly generalizes the behavior of this grocery store counter. the default constructor should create a counter object that can count up to and have a value of 0. the object should have a public member function void setlimit(int ) that resets the counting limit from 1 to . when it is called it should call the reset function. if setcounter's argument is less then or equal to 0 or greater then the mutator should throw an exception. the member function void reset( ) ; sets the counter’s number to 0 . the member function void incr1( ) ; increments the units digits by 1 , void incr10( ); increments the tens digit by 1 , and void incr100( ); and void incr1000( ); increment the next two digits, respectively. accounting for any carrying when you increment should require no further action than adding an appropriate number to the private data member. a member function bool overflow( ); detects overflow. overflow is the result of incrementing the counter’s private data member beyond the maximum created by the default constructor or setcounter. overflow should be called after any series of calls to any of the incrementor functions. if overflow occurs the counter limit should be reported, and the fact that the counter has been reset to 0 by calling the reset function. use this class to provide a simulation of my mother’s little red clicker. the clicker is represented by an integer on the screen. the rightmost (lower order) two digits are alwaysthought of as cents and tens of cents, the next digit is dollars, and the fourth digit is tensof dollars but no special formatting is to be done to represent this on the screen. the class should have a member functions: int getcounterand int getlimit that when called returns the current value of the clicker and the current limit. these functions should be called by the main program after the clicker's limit is set, when it is incremented , reset, or overflow happens. provide keys for cents, dimes, dollars, tens of dollars, and reset. use the keys asdfrq: a for cents; i for dimes; d for dollars; f for tens of dollars; r for the reset function; s to set counter and q to quit. once a letter is selected and return is pressed the user is asked to enter a digit between 1 and 9 . the appropriate member function, based on whether asdf was pressed, should be called 1 to 9 times toincrement the counter.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 18:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
question
Engineering, 04.07.2019 19:10
What is the main objective of using reheat rankine cycle?
Answers: 3
question
Engineering, 04.07.2019 19:20
List 3 options on how to reduce knocking problens during engine process,
Answers: 2
You know the right answer?
My mother always took a little red counter to the grocery store . the counter wasused to keep tally...
Questions
question
History, 15.11.2019 12:31
question
Geography, 15.11.2019 12:31
question
English, 15.11.2019 12:31