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 m 1.5 kg of steam is contained in a closed rigid container. initially the pressure and temperature of the steam are: p 1.5 mpa and t 240°c (superheated state), respectively. then the temperature drops to t2= 100°c as the result of heat transfer to the surroundings. determine: a) quality of the steam at the end of the process, b) heat transfer with the surroundings. for: p1.5 mpa and t 240°c: enthalpy of superheated vapour is 2900 kj/kg, specific volume of superheated vapour is 0. 1483 m/kg, while for t 100°c: enthalpy of saturated liquid water is 419kj/kg, specific volume of saturated liquid water is 0.001043m/kg, enthalpy of saturated vapour is 2676 kj/kg, specific volume of saturated vapour is 1.672 m/kg and pressure is 0.1 mpa.
Answers: 3
question
Engineering, 03.07.2019 15:10
Ahouse has the following electrical appliance usage (1) single 40w lamp used for 4 hours per day (2) single 60w fan used for 12 hours per day (3) single 200w refrigerator that runs 24 hours per day with compressor run 12 hours and off 12 hours find the solar power inverter size in watt with correction factor of 1.25.
Answers: 1
question
Engineering, 04.07.2019 18:10
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
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
Mathematics, 04.05.2021 01:00
Questions on the website: 13722363