Question: I need help I am inputting the following code into the complier for C++ and I get error message saying automobile.h no such file is
I need help I am inputting the following code into the complier for C++ and I get error message saying "automobile.h no such file is found. Please help this is for chapter 10 question 4 in the Program logic and design book.
#include
#include
#include "AutoMobile.h"
using namespace std;
int main()
{
Automobile myAuto;
myAuto.getDetails();
myAuto.displayOutput();
system("pause");
return 0;
}
void Automobile::getDetails()
{
cout << "Enter the VIN:";
cin >> VIN;
setVIN(VIN); // Vehicle Identification
cout << "Enter the make:";
cin >> MAKE;
setMAKE(MAKE);
cout << "Enter the model:";
cin >> MODEL;
setMODEL(MODEL);
cout << "Enter the color:";
cin >> COLOR;
setCOLOR(COLOR);
}
//Automobile.h
#include
using namespace std;
class Automobile
{
private:
string VIN;
string MAKE;
string MODEL;
string COLOR;
public:
void getDetails();
Automobile();
void setVIN(string vin);
void setMAKE(string make);
void setMODEL(string model);
void setCOLOR(string color);
string getVIN();
string getMAKE();
string getMODEL();
string getCOLOR();
void displayOutput();
};
//Automobile.cpp
#include
#include "Automobile.h"
using namespace std;
Automobile::Automobile()
{
VIN = "";
MAKE = "";
MODEL = "";
COLOR = "";
}
void Automobile::setVIN(string vin)
{
VIN = vin;
}
void Automobile::setMAKE(string make)
{
MAKE = make;
}
void Automobile::setMODEL(string model)
{
MODEL = model;
}
void Automobile::setCOLOR(string color)
{
COLOR = color;
}
string Automobile::getVIN()
{
return VIN;
}
string Automobile::getMAKE()
{
return MAKE;
}
string Automobile::getMODEL()
{
return MODEL;
}
string Automobile::getCOLOR()
{
return COLOR;
}
void Automobile::displayOutput()
{
cout << " -------------------------------------------------"< cout << "Vehicle Identification Number: " << VIN << endl << "MAKE: " << MAKE << endl << "MODEL: " << MODEL << endl << "COLOR: " << COLOR << endl; cout << "-------------------------------------------------" << endl; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
