Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a parking area in city centre. Cars parking in are expected to pay $2. Mostly they do, but sometimes a car goes by without

Consider a parking area in city centre. Cars parking in are expected to pay $2. Mostly they do, but sometimes a car goes by without paying. The parking machine keeps track of the number of cars that have gone by, and of the total amount of money collected. Model this parking with a program called Parking. The two data items are a type unsigned int to hold the total number of cars, and a type double to hold the total amount of money collected. Initializes both values to 0. A member function called payingCar( ) increments the total car and adds $2 to the cash total. Another function called no_payCar( ), increments the car total but adds nothing to the cash total. Finally, a member function called display( ) displays the two totals. Make appropriate member functions constant. This program should be menu driven that will allow customers to select from menu, for example 1 for paying car, 2 for non paying car and 3 for total cars and cash.

Note: If you think you need extra function or variable for smooth execution of your program you are allowed to do so.

(In C++ language)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions