Answered step by step
Verified Expert Solution
Link Copied!

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability and Random Processes With Applications to Signal Processing and Communications

Authors: Scott Miller, Donald Childers

2nd edition

123869811, 978-0121726515, 121726517, 978-0130200716, 978-0123869814

More Books

Students also viewed these Programming questions

Question

What characteristics do all land plants have in common?

Answered: 1 week ago

Question

=+a) What is the minimax choice?

Answered: 1 week ago

Question

Calculate the missing values for the promissory notes described

Answered: 1 week ago