Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help me with a car base class that follows these requirements: in C++ The car base class shall have a method to display a car's
help me with a car base class that follows these requirements: in C++
- The car base class shall have a method to display a car's make, model, and year built.
- Design a sports car class that inherits from the car class. The sports car class shall take in the same information as the base class but will also include the top speed of the sports car and its zero to 60 MPH time in seconds. The sports car class shall override the base function print method. The override print method shall display make, model, year built, top speed, and zero to 60 time.
- Design a truck class that inherits from the car class. The truck class shall include information about the cargo size in cubic feet and the maximum cargo weight. Create a print method that overrides the print method in the base class. This method shall only output the model of the truck, cargo size in cubic feet and maximum cargo weight.
- Create two sports car and two truck objects.
- For one truck and one sports car object, set the values through an overloaded constructor.
- For the second set of objects set the values through mutators (setters) and accessors (getters).
- Your program shall demonstrate the use of the print function for each object.
- Your program shall demonstrate at least one instance of pointer reference and dereference (done without a smart pointer) and one smart pointer.
- Implement and use at least one friend function. You may choose the functionality of the friend function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started