trying to display rates

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.

i underlined the code that isnt working.


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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// newproject2.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <fstream>
#include <string>
#include <math.h>

using namespace 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;
}
Topic archived. No new replies allowed.