Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, please use C++ and include cpp and header files for each class. Will rate! Thanks. C++ programming question For each class of parts a,

Hi, please use C++ and include cpp and header files for each class. Will rate! Thanks.

image text in transcribed

C++ programming question For each class of parts a, b and c, include one or more constructors, destructor and the necessary set and get functions. Also, provide a print function for each class which outputs all the data members of that class. a) Define a class Date that has the following data members: month, day and year. b) Define a class Vehicle that has the following data members: Model of the vehicle (e.g., Ford, Toyota) as a standard library string. The date that vehicle has joined to the fleet from part (a). The mileage of the vehicle as an integer. A four digit id of the vehicle as a standard library string, such as string vehicle id- "2345", A two-dimensional 12-by-30 array of Boolean variables that shows whether the vehicle is available or has been rented out for each day of the year. If the vehicle is available on a given date then Boolean variable is true and if rented out is false. Each row of the array corresponds to a month and for simplicity we assume that the number of days in each month is 30. c) Derive a Car class from the Vehicle class, the class should have an additional data member for the passenger capacity as an integer. Derive a Truck class from the Vehicle class, the class should have an additional data member for the weight limit of the truck as an integer. DELIVERABLES: date.cpp, date.h, vehicle.cpp, vehicle.h, car.cpp, car.h, truck.cpp, truck.h, test.cpp

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

Question

Python refer to this previous question for the code...

Answered: 1 week ago