Question: Design and implement an abstract data type called Car. Support the following operations: ability to set make and model, ability to shift gear up
Design and implement an abstract data type called Car. Support the following operations: ability to set make and model, ability to shift gear up or down (assume a max of 6-speed), ability to shift lanes (left or right; assume a max of three lanes), accelerate and decelerate (in units of 5 mph), and display the current state of the car (show the make, model, current gear number, current lane and speed). Instantiate some Car objects in your main function and take them for a spin. Make sure to support: (a) Default constructor (b) Parameterized constructors (c) Copy constructor (d) Destructor (e) const keywords as appropriate (f) Overloaded= operator (g) Overloaded == operator For the make and model of a Car, you could use the string type. Research about the string type in C++ and use it appropriately. It is fairly simple.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
