//HAM JING YI A19EC0048
//Program 8.4
#include<iomanip>
#include<iostream>
using namespace std;

class Automobile
{
	private:
		string make;
	
	protected:
		int model;
	
	public:
		double price;
		
		Automobile()
		{
			make="";
			model=0;
			price=0.0;
			cout<<"An Automobile object has been created but "
				<<"not yet have details."<<endl;
		}
		
		Automobile(string a,int b,double c)
		{
			make=a;
			model=b;
			price=c;
			cout<<"Automobile object: "<<make<<" makes in "
				<<model<<". The price is RM "<<price<<"."
				<<endl;
		}
		
		void printInfo()
		{
			
		}
};//End class Automobile

class Car: private Automobile
{
	private:
		int doors;
	
	public:
		Car():Automobile("BMW",2010,150000.0)
		{
			doors=0;
			cout<<"Car with car's make, year model and price "
				<<"(\"BMW\", 2010, 150000.0) accordingly. "
				<<endl;
		}
		Car(string a,int b,double c,int d):Automobile(a,b,c)
		{
			doors=d;
			cout<<a<<"'s car has "<<d<<" doors."<<endl;
		}
		void printCar()
		{
			
		}
};//End class Car

class Truck: protected Car
{
	protected:
		string driveType;
	
	public:
		Truck(string d):Car("Toyota",2014,45000.0,4)
		{
			driveType=d;
			cout<<"This is the truck with "<<d
				<<" drive type."<<endl;
		}
		void printTruck() 
		{
			
		}
};//End class Truck

int main()
{
	cout<<fixed<<setprecision(2);
	
	Car car;
	Truck truck("4WD");
	Automobile automobile;
	
	return 0;
}
