Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are designing a simple application for an electric cars - only parking garage company. This garage assumes there are only 3 brands of cars

You are designing a simple application for an electric cars-only parking garage company. This garage assumes there are only 3 brands of cars (Rivian, Tesla, and ViaFast), and 3 types of cars (Sedan, SUV, and Truck) with only 5 available car colours (Black, White, Blue, Silver, and Grey). Write a C++ class (EV) based on the following:
\table[[EV],[colour: string],[plateNumber: string],[type: string],[slotNumber: int],[parkingFee: double],[totalParkingFee: static double],[carCount: static int],[EV O],[EV (string, string, string, string)],[EV (const EV &)],[setBrand(string): void],[setColor(string): void],[setPlateNumber(string): void],[setType(string): void],[printCarDetails(): void],[getTotalParkingFees(): static double],[getCarCount(): static int],[ EV O]]
i. Initialize "totalParkingFees" to 0.0 and "carCount" to 0.
ii. The default constructor will prompt the user to enter the details of the car (brand, colour, plateNumber, and type). Ensure the entered values for brand, colour, and type are valid. If not, prompt the user to re-enter until valid values are provided. Set parking fees based on the car type (Sedan: 20, SUV: 30, Truck: 40). Update "totalParkingFee"
accordingly. Increment "carCount" and set slot number (assign the new "carCount" to slot).
iii. The parameterized constructor accepts brand, plateNumber, colour, and type. Repeat step ii.
iv. The copy constructor copies details for an existing car object. Increment "carCount", update "totalParkingfee", and set slot number.
v. The destructor updates "totalParkingfee" and "carCount". Print appropriate deletion message.
vi. Create setters and getters methods. Update "totalParkingfee" in "setType".
vii. Create "printCarDetails" method.
In the main:
i. Create "ev1" using default constructor.
ii. Create "ev2" using parameterized constructor.
iii. Create "ev3" using copy constructor from "ev2".
iv. Create "ev4" using parameterized constructor. Prompt user for details.
v. Update "ev3" details using setter methods.
vi. Print all the cars details.
vii. Print the daily statistics (Average income = totalParkingFees/carCount).
image text in transcribed

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

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago