// Debug 5-2
cout<<"Enter vehicle ID - use 3 digits ";
while(vehicleID < 99 && vehicleID > 1000)
cout<<"Use 3 digits please ";
cout<<"Enter price ";
cout<<"Enter year of car ";
while(year < 1940 && year > 2005)
cout<<"Check the year and reenter ";
cout<<"Enter miles on vehicle ";
yearsOld = 2005 - year;
if(miles < yearsOld * 8000)
cout<<"This is a low mileage car";
else if(miles < yearsOld * 15000)
cout<<"This is an average mileage car";
else cout<<"That is a lot of miles for the age";
// Debug 5-4
static int rentDueDate;
void setOfficeData(int num, char occupant, int rent);
static void showRentDueDate();
int rentDueDate = 1;
void Office::setOfficeData(int num, char occupant, int rent)
officeNum = num;
rent = rent;
cout<<"Office "<<officeNum<<" is occupied by "<<tenant<<endl;
cout<<"The rent $"<<rent<<" is due on day "<<rentDueDate<<" of the month"<<endl;
cout<"All rents are due on day "<rentDueDate<" of the month"<endl;
myOffice.setOfficeData(234,"Dr. Albright", 450);
private prevents using things. So for #1 your first problem is making all the methods you call in main private, where they can't be called because they are private... use public: on the ones you need to call from main, and private on the rest (and actual variables).
void main is not legal in standard c++. Avoid this style, though most windows compilers will accept it.
Going forward we can help but..
- please insert the code in code tag blocks
- please tell us what exactly is wrong with them
- lets work on one at a time maybe.
- is this one of those problems where the teacher gives you busted code to fix, or did you write these?
rent=rent is probably wrong but it will compile etc. its probably this->rent = rent, which highlights the self inflicted misery of using the same variable name twice in one block of code.