Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
I am using for spaces due to this app class toll totalmon...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started