Challenge

Project 3

Build an object-oriented library which can be used to track automobile maintenance. There can be different car types such as petrol, diesel, gas, electric etc., This library should be able to support at least three of the car types. 

Maintenance tasks include activities like oil change or replace oil filter, replace air filter, replace fuel filter, tire rotations, infotainment system debug, replace spark plugs, replace the cabin or a/c filter, check the level and refill clutch fluid or brake fluid, examine belts, wipers, hoses, check the tire conditions, check the charging systems and battery. 

#include
#include
using namespace std;
#include
#define size 2

enum Type {
GAS,
DIESEL,
ELECTRIC
};
// create the class function
class Vehicle {
public:
string make;
string model;
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 the Vehicle:";
    cin>>make;

}
void Vehicle::putmake()
 {
    cout<< " \t:"<}

void Vehicle::setmodel()
 {
    cout<< " Enter the model of the Vehicle:";
    cin>>model;

}
void Vehicle::putmodel()
 {
    cout<< " \t:"<}

void Vehicle::setyear()
 {
    cout<< " Enter manufacured year of the Vehicle:";
    cin>>year;

}
void Vehicle::putyear()
 {
    cout<< " \t:"<}

void Vehicle::setodometer()
 {
    cout<< " Enter odameter of the Vehicle:";
    cin>>odometer;

}
void Vehicle::putodometer()
 {
    cout<< " \t:"<}


//create menu card

void menudisplay()
{
    cout<<"0.Quit.\n";
    cout<<"1.displayservices.\n";
    cout<<"2.add vehicle.\n";
}

void displayservices()// service list display 
{
    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 the level"<    cout<<"refill clutch fluid"<    cout<<"brake fluid,examine belts,wipers, hoses"<    cout<<"check the tire conditions, check the charging systems, battery"<    
}

int main()
{
    int user_choice;
    beginning:menudisplay();
    cout<<"Enter your choice in no"<    cin>>user_choice;
    switch(user_choice)
    {
        case 0 :cout<<"Existing 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.