Hi, thanks for the help before. My problem now is the final part where it is supposed to display the rates of month, day and week that was declared above, but when compiled throws out a random number.
// newproject2.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
usingnamespace std;
class userMenu{
public:
userMenu();
string homeMenu;
string add;
string remove;
string edit;
}; //webUser menu class
userMenu::userMenu(){
cout<<"Select an option below (1,2,3)"<<endl
<<"1. Add Booking"<<endl
<<"2. Edit Booking"<<endl
<<"3. Remove Booking"<<endl;
};
class addBooking{
public:
addBooking();
string addMenu;
string bookName;
int startDate;
int currentDate;
int lengthStay;
}; //add booking class
addBooking::addBooking(){
cout<<"Welcome to the Add Booking Menu!:"<<endl;
}; //contructor
class rates{
public:
rates();
int displayRates();
int monthRate;
int weekRate;
int dayRate;
};
rates::rates(){
int dayRate=100;
int weekRate=300;
int monthRate=900;
};
class newUser{ //new user class
public:
newUser();
string name;
string password;
};
newUser::newUser(){ //new user constrctor
cout<<"Welcome new user!:"<<endl;
};
int main(){
int add=1;
int edit=2;
int remove=3;
newUser newUserOne;
cout<<"Please enter user name:"<<endl;
cin>>newUserOne.name;
cout<<endl;
cout<<"Please enter passworrd:"<<endl;
cin>>newUserOne.password;
userMenu menuOne;
cout<<menuOne.homeMenu<<endl;
if(cin>>add){
cout<<"If Booked 2 weeks in advanced, 3% off lodging only"<<endl;
addBooking addMenu;
cout<<"Please enter book name:"<<endl;
cin>>addMenu.bookName;
cout<<endl<<"please enter toady's date(yyyymmdd):"<<endl;
cin>>addMenu.currentDate;
cout<<endl<<"please enter start date:(yyyymmdd)"<<endl;
cin>>addMenu.startDate;
rates showRate;
cout<<"Monthly Rate:"<<showRate.monthRate<<endl
<<"Week Rate:"<<showRate.weekRate<<endl
<<"Day Rate:"<<showRate.dayRate<<endl;
cout<<"Please enter length of stay:"<<endl;
cin>>addMenu.lengthStay;
cout<<addMenu.lengthStay/30<<"Months"<<endl
<<addMenu.lengthStay%30/7<<"Weeks"<<endl
<<addMenu.lengthStay%30%7<<"Days"<<endl;
}
return 0;
}