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. [CLO-3, PLO-3]

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

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

Students also viewed these Databases questions