Question: Implement the following question with Class: Avionics 6 batch is assigned a task to develop a Toll Tax Collection program for National Grand Truck

Implement the following question with Class: Avionics 6 batch is assigned a 

Implement the following question with Class: Avionics 6 batch is assigned a task to develop a "Toll Tax Collection" program for National Grand Truck Road. Cars passing by the booth are expected to pay a 5OPKR toll. Mostly they do, but sometimes a car goes by without paying such as an ambulance. The tollbooth keeps track of the number of cars that have gone by, the total amount collected, and the registration number of cars for security purposes. Model this tollbooth with a class called tollBooth. The attributes are 1) total number of cars (int), 2) total amount of money collected (int), and 3) Registration number of cars (list or NumPy array). A method called payingCar() increments the total number of cars, adds 50PKR to the cash total and append the registration number of the car in the existing list/array. Another method, called nopayCar(), increments the car total but adds nothing to the cash total and also append the registration number. Finally, a member function called display() displays the total cash, total number of cars, and registration number of all of the cars.

Step by Step Solution

3.47 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

I am using for spaces due to this app class toll totalmon... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!