Project 3
ABINAYA INBAMANI, BATCH-26
#include<iostream>
using namespace std;
#define size 2
#define MAXKM 50000
class vehicle{
public:
string make,model,type;
enum TYPE{GAS,ELECTRIC,DIESEL};
int year;
float odometer;
virtual void setmake();
virtual void putmake();
virtual void setmodel();
virtual void putmodel();
virtual void setyear();
virtual void putyear();
virtual void setodometer();
virtual void putodometer();
};
void vehicle:: setmake()
{
cout<<"Enter the make of vehicle"<<endl;
cin>>make;
}
void vehicle::putmake()
{
cout<<"\t"<<make;}
void vehicle::setmodel()
{
cout<<"Enter the model of vehicle"<<endl;
cin>>model;
}
void vehicle::putmodel()
{
cout<<"\t"<<model;}
void vehicle::setyear()
{
cout<<"Enter the manufacturing year of the vehicle"<<endl;
cin>>year;
}
void vehicle::putyear()
{
cout<<"\t"<<year;
}
void vehicle::setodometer()
{
cout<<"Enter the reading of the odometer"<<endl;
cin>>odometer;
}
void vehicle::putodometer()
{
cout<<"\t"<<odometer<<endl;
if(odometer>50000)
{
cout<<"Tyre Rotation to be done"<<endl;
}
else
{
cout<<"Less than 50000 KMS. Tyre rotation can be done in next vsit."<<endl;
}
}
void menudisplay()
{
cout<<"0.Quit\n1.displayservises\n2.Addvehicle\n"<<endl;
}
void displayservises()
{
cout<<" oil change or replace oil filter"<<endl;
cout<<"replace air filter, replace fuel filter"<<endl;
cout<<"tire rotations, infotainment system debug, replace spark plugs"<<endl;
cout<<"replace the cabin or a/c filter, check the level and refill clutch fluid or brake fluid"<<endl;
cout<<"examine belts, wipers, hoses, check the tire conditions, check the charging systems and battery."<<endl;
}
int main()
{
int user_choise;
beginning:menudisplay();
cout<<"Enter your choice in no."<<endl;
cin>>user_choise;
switch(user_choise)
{
case 0: cout<<"exiting the loop"<<endl;
break;
case 1:
displayservises();
goto beginning;
case 2:
vehicle *pv=new vehicle();
pv->setmake();
pv->setmodel();
pv->setyear();
pv->setodometer();
pv->putmake();
pv->putmodel();
pv->putyear();
pv->putodometer();
goto beginning;
}
}