Engineering
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.

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 19:30, 10040813
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
image
Engineering, 04.07.2019 18:10, hadellolo8839
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
image
Engineering, 04.07.2019 18:10, bunnles
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 18:20, hayleymckee
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
Do you know the correct answer?
My mother always took a little red counter to the grocery store . the counter wasused to keep tally...

Questions in other subjects:

Konu
Mathematics, 19.01.2021 19:10
Konu
English, 19.01.2021 19:10