Hello!!
So for my project which I am not completely sure yet if I did the coding correctly I get the following error ([Error] expected primary-expression before 'myAuto'). I would appreciate if someone can help me and explain me what this error is about, how can I fix it, and how can I prevent the same error in a future.
Thank you so much in advance.
// Start
// Declarations
// Automobile myAuto
// string vin
// string make
// string model
// string color
// output "Please enter the Vehicle Identification Number: "
// input vin
// output "Please enter the Make: "
// input make
// output "Please enter the Model: "
// input model
// output "Please enter the color: "
// input color
// Set the VIN for myAuto
// Set the Make for myAuto
// Set the Model for myAuto
// Set the Color for myAuto
// output "VIN: ", myAuto.getVin()
// output "Make: ", myAuto.getMake()
// output "Model: ", myAuto.getModel()
// output "Color: ", myAuto.getColor()
// Stop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <iostream>
#include <cstdlib>
#include <string>
#include "Automobile.h"
#include "Automobile.cpp"
using namespace std;
int main
{
Automobile myAuto
string vin
string make
string model
sting color
cout << "Please enter the Vehicle Identification Number: " << endl;
cin >> vin;
cout << "Please enter the Make: " << endl;
cin >> make;
cout << "Please enter the Model: " << endl;
cin >> model;
cout << "Please enter the color: "<< endl;
cin >> color;
myAuto.setVIN(vin);
myAuto.setMake(make);
myAuto.setModel(model);
myAuto.setColor(color);
cout << "VIN: " << myAuto.getVIN() << endl;
cout << "MAKE: " << myAuto.getMake() << endl;
cout << "MODEL: " << myAuto.getModel() << endl;
cout << "Color: " << myAuto.getColor() << endl;
system("PAUSE")
return 0;
}
|