Imagine a tollbooth with a class called toll booth the two


Program

Imagine a tollbooth with a class called toll booth. The two data items are of type unsigned int to hold the total number of cars, and a type double to hold the total amount of money collected. A constructor initializes both these to 0. A member functions called payingcar() increments the car total and adds 0. 50 to the cash total. Another function, called nopaycar(), increments the car total but adds nothing to the cash total. Finally a member function called displays the two totals. 

Include a program to test this class. This program should allow the user to push one key to count a nopaycar. Pushing the ESZ key should cause the program to printout the total cars and total cash and then exit. 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Imagine a tollbooth with a class called toll booth the two
Reference No:- TGS01475509

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)