I need help trying to fix the errors in my class program. The comments to the sides are the requirements for the program. My compiler says that there are a bunch of things undeclared. I am new to C++ so please don't be too harsh on me. I am suppose to print out the initial value of age & price and the modified value of age & price. Any help on trying to run this program would be very helpful.
#include <iostream>
using namespace std;
Class Vehicle {
private:
int Age; //The age of the vehicle
protected:
float Price; //The price of the vehicle
public:
Vehicle(int Age=0,int Price=0.0;) //default constructor sets age=0, and price=0.0
~Vehicle() (Age=0,Price=0.0;) //destructor sets age=0, and price=0.0
setAge(int Age); //Takes an integer parameter, returns nothing
setPrice(float Price); //Takes a float parameter, returns nothing
int getAge(){return Age;};// Takes no parameters, returns the vehicle’s age
float getPrice(){return Price;}; // Takes no parameters, returns the vehicle’s price
};
int main()
{
Vehicle x;
cout << "Initial value for x: " << endl;
cout << "Age = " << x.getAge() << " Price= " << x.getPrice() << endl;
x.setAge(40);
x.setPrice(20000);
cout << "Modified value for x: " << endl;
cout << "Age = " << x.getAge() << " Price= " << x.getPrice() << endl;
return 0;
}