help me with a car base class that follows these requirements: in C++ The car base class
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date: