#include <iostream>
using namespace std;
enum type{Gas,Diesel,Electric};
class automobile_maintenence
{
protected:
string make,model;
int year,odometer,type;
public:
automobile_maintenence()
{
cout<<"To the Make of the vehicle :"<<endl;
cin>>make;
cout<<"The Model of the vehicle :"<<endl;
cin>>model;
cout<<"Which year vehicle launched"<<endl;
cin>>year;
cout<<"the odometer reading in the vehicle"<<endl;
cin>>odometer;
cout<<"Choosen for car \n 1 for Gas Vehicle \n 2 for Diesel Vehicle \n 3 for Electric Vehicle"<<endl;
cin>>type;
}
};
class maintenence : public automobile_maintenence
{
protected:
int t,c;
public:
void checkTireRotaion()
{
cout<<"Check Based on Tire Rotation "<<endl;
if(odometer >=50000)
{
cout<<"car tire to want to be service :"<<endl;
}
else
{
t=(50000-odometer);
cout<<"The tire is good condition but after "<<t<<"KM must be want service "<<endl;
}
}
void checkchargePower()
{
cout<<"information based on battery charge"<<endl;
if(odometer >= 400)
{
cout<<"The battery charger must be change"<<endl;
}
else
{
c=(400 - odometer);
cout<<"the battery charge is good change but after \n"<<c<<"remain must be changed"<<endl;
}
}
};
class car : public automobile_maintenence
{
protected:
int n;
public:
void fun()
{
cout<<"the information based on the customer vehicle: "<<endl;
cin>>n;
switch(n)
{
case 1:
cout<<"GAS type vehicle came to service"<<endl;
cout<<"it runs in liquidfied gas"<<endl;
break;
case 2:
cout<<"DIESEL type vehicle came to service"<<endl;
cout<<"it runs in liquid petrolium"<<endl;
break;
case 3:
cout<<"ELECTICAL type vehicle came to service"<<endl;
cout<<"it runs in rechargeable battery"<<endl;
break;
default:
cout<<"invalid type of vehicle to select"<<endl;
break;
}
}
};
int main()
{
int n;
maintenence m;
car c;
m.checkTireRotaion();
m.checkchargePower();
c.fun();
int y;
cin>>y;
switch(n)
{
case 1:
cout<<"thanks for doing service with us "<<endl;
cout<<"have a safe journey"<<endl;
break;
case 2:
cout<<"the list of the inventory details have been uploaded in a proper manner"<<endl;
cout<<"the list has been got approved from RTO"<<endl;
break;
case 3:
cout<<"if you want to add the another vehicle bill means we can add it"<<endl;
cout<<"you said no need ok"<<endl;
break;
case 4:
cout<<"the old parts has been replaced with the updated parts in the market"<<endl;
cout<<"its an wonderful update in the year"<<endl;
break;
case 5:
cout<<"there is no vehicle is added in the list to remove"<<endl;
break;
case 6:
cout<<"the rotation is in good condition"<<endl;
cout<<"there is no need to change the tire"<<endl;
break;
case 7:
cout<<"the oil tank in the car cleaned completely"<<endl;
cout<<"the new oil is filled in the tank"<<endl;
break;
case 8:
cout<<"as per the customer requirement the battery has changed to new version"<<endl;
cout<<"the battery recharged fully and it has 2 year life time"<<endl;
break;
}
}
Output
To the Make of the vehicle :
tesla
The Model of the vehicle :
xyz
Which year vehicle launched
2015
the odometer reading in the vehicle
500
Choosen for car
1 for Gas Vehicle
2 for Diesel Vehicle
3 for Electric Vehicle
1
To the Make of the vehicle :
ola
The Model of the vehicle :
abc
Which year vehicle launched
2014
the odometer reading in the vehicle
300
Choosen for car
1 for Gas Vehicle
2 for Diesel Vehicle
3 for Electric Vehicle
1
Check Based on Tire Rotation
The tire is good condition but after 49500KM must be want service
information based on battery charge
The battery charger must be change
the information based on the customer vehicle:
1
GAS type vehicle came to service
it runs in liquidfied gas
Killed