Challenge

Project 3

#include
using namespace std;
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 make of the Vehicles"<    cin>>make;
}
void Vehicle::putmake()
{
    cout<<"\t"<}
void Vehicle::setmodel()
{
    cout<<"Enter model of the Vehicles"<    cin>>model;
}
void Vehicle::putmodel()
{
    cout<<"\t"<}

void Vehicle::setyear()
{
    cout<<"Enter Year of the Vehicle is Manufactured"<    cin>>year;;
}
void Vehicle::putyear()
{
    cout<<"\t"<}
void Vehicle::setodometer()
{
    cout<<"Enter the speedometer of the vehicle"<    cin>>odometer;
}
void Vehicle::putodometer()
{
    cout<<"\t"<

if(odometer>50000)
{
    cout<<"\n Tyre Rotation to be done"<}
else
{
    cout<<"\n The Tyre rotation can be done only when the it is more the 50000KMS"<}
}
void menudisplay()
{
    cout<<"0 Quit\n";
    cout<<"1 Display Services"<    cout<<"2 Add Vehicles"<}
void displayservices()
{
    cout<<"\n oil change or replace oil filter,replace air filter"<    cout<<"replace fuel filter,tire rotations,infotainment debug"<    cout<<"replace spark plug,replace the cabin filter,check level refill the clutch fluid"<    cout<<"Brake Fluid,Examine belts,wipers,hoses,check the battery and charging systems,check the tire conditions"<}
int main()
{
    int user_choice;
    beginning: menudisplay();
    cout<<"enter the user choice in numbers"<    cin>>user_choice;
    switch(user_choice)
    {
      case 0 : cout<<"Exiting the program" ;
      break ;
      case 1:displayservices();
      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;
    }
}

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.