Question: Imagine a tollbooth with a class called TollBooth. The two data items are of type int and double to hold the total number of
Imagine a tollbooth with a class called TollBooth. The two data items are of type int and double to hold the total number of cars and total amount of money collected. A constructor initializes both of these data members to O. A member function called payingCar() increments the car total and adds 0.5 to the cash total. Another function called nonPayCar() increments the car total but adds nothing to the cash total. Finally a member function called display() shows the two totals. Include a program to test this class. This program should allow the user to push one key to count a paying car, and another to count a non paying car. Pushing the 'E' key should cause the program to print out the total number of cars and total cash and then exit
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
The detailed ... View full answer
Get step-by-step solutions from verified subject matter experts
