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, 04.07.2019 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 19:10
Plan an experiment to measure the surface tension of a liquid similar to water. if necessary, review the ncfmf video surface tension for ideas. which method would be most suitable for use in an undergraduate laboratory? what experimental precision could be expected?
Answers: 2
question
Engineering, 04.07.2019 19:20
Consider airflow over a flat plate of length l = 1.5 m under conditions for which transition occurs at le = 0.9 m based on the critical reynolds number, re,e = 5 x 10. evaluating the thermophysical properties of air at 400 k, determine the air velocity. (hint: use the tables to find the properties of air)
Answers: 3
question
Engineering, 04.07.2019 19:20
Air at a pressure of 1atm and a temperature of 40 c is in parallel flow over the top surface of a flat plate that is heated to a uniform temperature of 120 c. the plate has a length of 0.40m (in the flow direction) and a width of 0.15m. the reynolds number based on the plate length is 50, 000. what is the rate of heat transfer from the plate to the air? if the free stream velocity of the air is doubled and the pressure is increased to 10 atm what is the rate of heat transfer?
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
Mathematics, 19.03.2021 19:00
question
Mathematics, 19.03.2021 19:00
question
Mathematics, 19.03.2021 19:00
question
Mathematics, 19.03.2021 19:00
question
Business, 19.03.2021 19:00
question
Mathematics, 19.03.2021 19:00
question
English, 19.03.2021 19:00
question
Mathematics, 19.03.2021 19:00
Questions on the website: 13722363