Question: i need the answer as soon as possible, please help me Given Program C-2 which consists of three classes. Automobile, Car and Truck, respectively. An


Given Program C-2 which consists of three classes. Automobile, Car and Truck, respectively. An object is created from each class as shown in the main function. 4 using namespace std; 5 class Automobile 6 private: string make; 8 protected: int model) 10 11 public: 12 int price; 13 Automobile (string make = "", int model = 0, int price = 0) { 14 this->make make; 15 this->model = model; 16 this->price = price; 17 3 18 19 void print () colat 20 cout doors = doors; 37 38 39 void print() const 40 41 cout wheel Drive - wheel Drive: 57 3 58 59 void print() consti 60 // The code for this method is for the question (c) 61 } 62 }; 63 64 65 int main() { Automobile automobile; Car car ("Ford" 2019, 150000); Truck truck; car.print(); 66 67 68 69 70 71 72 73 74 75 76 77 automobile.print(); automobile = car: automobile.print(); return 0; a. What will the program print at each of the following lines? i. Line 69: car.print(); ii. Line 71: automobile.print(); iii. Line 73-74: automobile = car; automobile.print(); b. Determine whether methods in class Car can access to the following attributes (or member variables). Write Yes if so, and No if otherwise. i. make ii. model iii. price iv. doors v. wheel Drive (5 marks) c. Complete the code for the method print () of class Truck. This method prints the detailed information about the truck including the make, model, price, number doors and type of wheel drive. The output should look like below: General Information Make : Ford Model: 2019 Price: 50000 This car is a 4WD truck The car has 4 doors. (6 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
