Menu

[Solved]Include Include Include Include Include Using Namespace Std Car Definition Class Car Decla Q37224784

#include <iostream>

#include <string>

#include <vector>

#include <cstdlib>

#include <fstream>

using namespace std;

//Car Definition.

class car

{

//declare variables

protected:

string VIN;

string Make;

string Model;

string category;

int year;

float price;

//Access specifier.

public:

//Constructor

car()

{

VIN = “”;

Make = “”;

Model = “”;

category = “”;

year = 0;

price = 0;

}

//Argumented constructor

car(string myvin, string mymake, string mymodel, int myyear,float myprice, string mycategory)

{

VIN = myvin;

Make = mymake;

Model = mymodel;

year = myyear;

price = myprice;

category = mycategory;

}

//Accessor function

string getCarVIN()

{

return VIN;

}

string getCarMake()

{

return Make;

}

string getCarModel()

{

return Model;

}

string getCarCategory()

{

return category;

}

int getCarYear()

{

return year;

}

float getCarPrice()

{

return price;

}

//Print Function.

virtual void print()

{

cout << endl << endl;

cout << “VIN:” << VIN << endl;

cout << “Make:” << Make << endl;

cout << “Model:” << Model << endl;

cout << “Year:” << year << endl;

cout << “Price:” << price << endl;

cout << “category:” << category << endl;

}

};

C++ I need to create a vector of cars with the properties shownand then sort that vector by Make and then save and load it to aseparate file

Expert Answer


Answer to #include #include #include #include #include using namespace std; //Car Definition. class car { //declare variables prot… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *