Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a c++ code for the question as asked inthe question in 40 minutes... Design a hierarchical class system for vehicle parking management in a

write a c++ code for the question as asked inthe question in 40 minutes...

image text in transcribed
Design a hierarchical class system for vehicle parking management in a building to store the data for maximum of 50 vehicles. The classes you need to design are: The VehicleInfo Class: This class will store the vehicle type(car, motorbike, bicycle, pickup) , model, color, vehicle# and number of minutes the vehicle has been parked as member variables. Define constructor to initialize the variables. Also make a getInfo function to get information from user. The VehicleMeter Class: Derives this class from VehicleInfo Class It has a member variable to store amount of charges for parking. Make a function to calculate the amount of charges as per the criteria of $10 for first hour and $5 would be added with each extra hour. Declare a bool variable legalStatus and make a function to check whether the vehicle was parked legally if the legalStatus is negative i.e. 0 then add an extra amount of $3.5 for each hour. Override the getInfo functions to get information from user. The VehicleSlip class: This class will be derived from VehicleInfo and VehicleMeter class. Define a member function which will issue a slip for parked vehicle displaying its information from VehicleInfo class, parking charges and legal staus respectively. In main function ask the user to enter the number of vehicles for which he wants to store record, he can maximum store record for 50 vehicles. If vehicles exceed the max value display an error message "Limit Exceeded!". Create an array of objects for VehicleSlip class to get information from user and generate their slips respectively. Also display the number of vehicles parked for each vehicle type at a given time. You can create more variables and functions other than listed above if needed. Question 2

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions