Who's ready to guid me in my Project ?!

Pages: 12
With one change , the code is working fine


string MainMenu::choose_from_main_menu (string choice)
{
cin>>choice;
return choice;
}

Am I missing something ???
Ok guys.. I added the return choice..
But I got a very weird error:
1>------ Build started: Project: cs102 proj, Configuration: Debug Win32 ------
1>Linking...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\fofa\Documents\Visual Studio 2005\Projects\cs102 proj\Debug\cs102 proj.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\fofa\Documents\Visual Studio 2005\Projects\cs102 proj\Debug\BuildLog.htm"
1>cs102 proj - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Hmm. That sounds like an error relating to your main and #includes.
Btw i didn't write the main yet. I'm compiling on separated files. Is that ok?

And about the error.. What should I do?
I'm not sure. I'm not really too good with linker errors.
What other files do you have? Put those up on pastebin. (that is, files besides the main menu)
Last edited on
I think its probably that you haven't got main() yet. Every program must have a main that returns something. Why not try quickly creating a main()?
Yep ! You were right.. I needed a main.
It is working now. Thanks..
I need a help with the main loop now though!
This is the loop.. It's not done yet.
But here when according to this code, the loop is supposed to stop when you enter 0.
Here the 0 is considered with the "else" and says invalid ! Why?
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
int number;
	do
	{
cout<<"Hello and welcome to J-Otaku-Air travel agency."<<endl
		<<"Please choose a number from the following menu, then press enter to "
		<<"move to the desired page."<<endl<<endl
		<<"1. About J-Otaku-Air"<<endl
		<<"* Press 0 to exit"<<endl<<endl;
cin>> number;

	if (number==1)
	{
		cout<<endl
		<<"J-Otaku-Air was founded on July 1990."<<endl
		<<"Fadia Banafe built this company with the goal of helping"<<endl
		<<"accommodate the curious nature of people and their need for exploration. "<<endl
		<<"Throuh out the years, J-Otaku-Air has been thriving to expand its services and"<<endl;
	cout<<"offer the best for their clients. And along their journey their hard work has"<<endl
		<<"been rewarded by many establishments."<<endl
		<<"In hopes of seeing you in one of our flights."<<endl<<endl
		<<"Sincerely,"
		<<endl
		<<"         J-Otaku-Air"
		<<"\t\t\t\t Fly Safe, Fly Otaku.."<<endl<<endl<<endl;
	}
	else
		cout<<"Invalid entry!!"<<endl<<endl;
	break;
	}while(number!=0);
else if(!number)

this code is very long, do you people think it's better if the messages is save on a textfile then retrieve it when need to shorten the code?
Last edited on
OMG ! I got 102 errors for the implementation of the PassengerMenu class!!!!
Please check it !

# include <iostream>
# include <string>
# include "PassengerMenu.h"
using namespace std;

int PassengerMenu:: Reservations()
{
int tkt_cost, yen_tkt_cost;
cout << "2. Reservations:"<<endl
<<endl
<< "Hello and welcome to the reservation area."<<endl
<< "Here you can choose your desired travel location and book a flight directly."<<endl
<<endl;
cout << "Would you like to continue? (Y/N)"<<endl;
cin>>choice;
if (choice== 'Y' ||choice=='y')
{

cout<<"Please choose a destination from the following list:"<<endl;
cout << "1.Hiroshima"<<endl;
cout << "2.Nagasaki"<<endl;
cout << "3.Osaka"<<endl;
cout << "4.Yokohama"<<endl;
cout << "0 to exit this menu."<<endl;
cin>> answer;
switch (answer)
{
case 1:
char convert_YN,pick_YN;
cout << "You chose Hiroshima, is that correct? (Y/N)\a"<<endl;
cin>> choice;
if ((choice=='Y') || (choice=='y'))
{
cout << "The price of each seat from Tokyo to Hiroshima costs 200 Dollars"<<endl;
cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
cin >> choice;
if ((choice=='Y') || (choice=='y'))
{
//convertion function call
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
Conversion_DOLLAR_TO_YEN();
}
else
{

cout << "How many seats would you like to reserve?"<<endl;
cin >> seats;
cout << "You have booked "<<seats<< " seats."<<endl;
tkt_cost=200*seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;

cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 months from the time of purchase."<<endl;
}
}
break;
case 2:
cout << "You chose Nagasaki, is that correct? (Y/N)\a"<<endl;
cin>> choice;
if ((choice=='Y') || (choice=='y'))
{
cout << "The price of each seat from Tokyo to Nagasaki costs 200 Dollars"<<endl;
cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
cin >> choice;
if ((choice=='Y') || (choice=='y'))
{
//convertion function call
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
Conversion_DOLLAR_TO_YEN();
}
else
{

cout << "How many seats would you like to reserve?"<<endl;
cin >> seats;
cout << "You have booked "<<seats<< " seats."<<endl;
tkt_cost=200*seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;

cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 months from the time of purchase."<<endl;
}
}
break;

case 3:
cout << "You chose Osaka, is that correct? (Y/N)\a"<<endl;
cin>> choice;
if ((choice=='Y') || (choice=='y'))
{
cout << "The price of each seat from Tokyo to Osaka costs 200 Dollars"<<endl;
cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
cin >> choice;
if ((choice=='Y') || (choice=='y'))
{
//convertion function call
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
Conversion_DOLLAR_TO_YEN();
}
else
{

cout << "How many seats would you like to reserve?"<<endl;
cin >> seats;
cout << "You have booked "<<seats<< " seats."<<endl;
tkt_cost=200*seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;

cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 months from the time of purchase."<<endl;
}
}
break;

case 4:
cout << "You chose Yokohama, is that correct? (Y/N)\a"<<endl;
cin>> choice;
if ((choice=='Y') || (choice=='y'))
{
cout << "The price of each seat from Tokyo to Yokohama costs 200 Dollars"<<endl;
cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
cin >> choice;
if ((choice=='Y') || (choice=='y'))
{
//convertion function call
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
Conversion_DOLLAR_TO_YEN();
}
else
{

cout << "How many seats would you like to reserve?"<<endl;
cin >> seats;
cout << "You have booked "<<seats<< " seats."<<endl;
tkt_cost=200*seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;

cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 months from the time of purchase."<<endl;
}
}
break;

}
}
double Conversion_DOLLAR_TO_YEN (double dollar_Z)
{
crvrtd_dl=dollar_Z*95.1384264;

return (crvrtd_dl);

}
Sorry forgot to put it between codes:


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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# include <iostream>
# include <string>
# include "PassengerMenu.h"
using namespace std;

int PassengerMenu:: Reservations()
{
	int tkt_cost, yen_tkt_cost;
cout << "2. Reservations:"<<endl
		 <<endl
		 << "Hello and welcome to the reservation area."<<endl
		 << "Here you can choose your desired travel location and book a flight directly."<<endl
		 <<endl;
		cout << "Would you like to continue? (Y/N)"<<endl; 
	cin>>choice;
	if (choice== 'Y' ||choice=='y')
	{
		
		cout<<"Please choose a destination from the following list:"<<endl;
		cout << "1.Hiroshima"<<endl;
		cout << "2.Nagasaki"<<endl;
		cout << "3.Osaka"<<endl;
		cout << "4.Yokohama"<<endl;
		cout << "0 to exit this menu."<<endl;
		cin>> answer;
		switch (answer)
		{
		case 1:
			char convert_YN,pick_YN;
			cout << "You chose Hiroshima, is that correct? (Y/N)\a"<<endl;
			cin>> choice;
			if ((choice=='Y') || (choice=='y'))
			{
				cout << "The price of each seat from Tokyo to Hiroshima costs 200 Dollars"<<endl;
				cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
				cin  >> choice;
				if ((choice=='Y') || (choice=='y'))
				{
					//convertion function call
					cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
				Conversion_DOLLAR_TO_YEN();
				}
				else 
				{
					
					cout << "How many seats would you like to reserve?"<<endl;
					cin  >> seats;
					cout << "You have booked "<<seats<< " seats."<<endl;
					tkt_cost=200*seats;
					cout << "The total cost of your ticket(s) will be:    "<<tkt_cost<<"$"<<endl;
					yen_tkt_cost=tkt_cost*95.1384264;
					cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
					
					cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
					cout << "Also, keep in mind that this ticket is only valade"<<endl;
					cout << "for 3 months from the time of purchase."<<endl;
				}
			}
		break;
	case 2:
		cout << "You chose Nagasaki, is that correct? (Y/N)\a"<<endl;
		cin>> choice;
			if ((choice=='Y') || (choice=='y'))
			{
				cout << "The price of each seat from Tokyo to Nagasaki costs 200 Dollars"<<endl;
				cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
				cin  >> choice;
				if ((choice=='Y') || (choice=='y'))
				{
					//convertion function call
					cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
				Conversion_DOLLAR_TO_YEN();
				}
				else 
				{
					
					cout << "How many seats would you like to reserve?"<<endl;
					cin  >> seats;
					cout << "You have booked "<<seats<< " seats."<<endl;
					tkt_cost=200*seats;
					cout << "The total cost of your ticket(s) will be:    "<<tkt_cost<<"$"<<endl;
					yen_tkt_cost=tkt_cost*95.1384264;
					cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
					
					cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
					cout << "Also, keep in mind that this ticket is only valade"<<endl;
					cout << "for 3 months from the time of purchase."<<endl;
				}
			}
		break;
	
	case 3: 
		cout << "You chose Osaka, is that correct? (Y/N)\a"<<endl;
		cin>> choice;
			if ((choice=='Y') || (choice=='y'))
			{
				cout << "The price of each seat from Tokyo to Osaka costs 200 Dollars"<<endl;
				cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
				cin  >> choice;
				if ((choice=='Y') || (choice=='y'))
				{
					//convertion function call
					cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
				Conversion_DOLLAR_TO_YEN();
				}
				else 
				{
					
					cout << "How many seats would you like to reserve?"<<endl;
					cin  >> seats;
					cout << "You have booked "<<seats<< " seats."<<endl;
					tkt_cost=200*seats;
					cout << "The total cost of your ticket(s) will be:    "<<tkt_cost<<"$"<<endl;
					yen_tkt_cost=tkt_cost*95.1384264;
					cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
					
					cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
					cout << "Also, keep in mind that this ticket is only valade"<<endl;
					cout << "for 3 months from the time of purchase."<<endl;
				}
			}
		break;	

case 4:
		cout << "You chose Yokohama, is that correct? (Y/N)\a"<<endl;
		cin>> choice;
			if ((choice=='Y') || (choice=='y'))
			{
				cout << "The price of each seat from Tokyo to Yokohama costs 200 Dollars"<<endl;
				cout << "Would you like to convert the amount into Yen?(Y/N)\a"<<endl;
				cin  >> choice;
				if ((choice=='Y') || (choice=='y'))
				{
					//convertion function call
					cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
				Conversion_DOLLAR_TO_YEN();
				}
				else 
				{
					
					cout << "How many seats would you like to reserve?"<<endl;
					cin  >> seats;
					cout << "You have booked "<<seats<< " seats."<<endl;
					tkt_cost=200*seats;
					cout << "The total cost of your ticket(s) will be:    "<<tkt_cost<<"$"<<endl;
					yen_tkt_cost=tkt_cost*95.1384264;
					cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
					
					cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
					cout << "Also, keep in mind that this ticket is only valade"<<endl;
					cout << "for 3 months from the time of purchase."<<endl;
				}
			}
		break;	

}
}
double Conversion_DOLLAR_TO_YEN (double dollar_Z)
{
crvrtd_dl=dollar_Z*95.1384264;

return (crvrtd_dl);

}
My dear.. I'm not very good with files..
I think I'd ruin the program if I used files more than it's already ruined!
I'm out of time n' need to finish it by today! :( I don't really think its a good idea for me to add files here.
Last edited on
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
int number;
	do
	{
cout<<"Hello and welcome to J-Otaku-Air travel agency."<<endl
		<<"Please choose a number from the following menu, then press enter to "
		<<"move to the desired page."<<endl<<endl
		<<"1. About J-Otaku-Air"<<endl
		<<"* Press 0 to exit"<<endl<<endl;
cin>> number;

	if (number==1)
	{
		cout<<endl
		<<"J-Otaku-Air was founded on July 1990."<<endl
		<<"Fadia Banafe built this company with the goal of helping"<<endl
		<<"accommodate the curious nature of people and their need for exploration. "<<endl
		<<"Throuh out the years, J-Otaku-Air has been thriving to expand its services and"<<endl;
	cout<<"offer the best for their clients. And along their journey their hard work has"<<endl
		<<"been rewarded by many establishments."<<endl
		<<"In hopes of seeing you in one of our flights."<<endl<<endl
		<<"Sincerely,"
		<<endl
		<<"         J-Otaku-Air"
		<<"\t\t\t\t Fly Safe, Fly Otaku.."<<endl<<endl<<endl;
	}
	else if (number!=0) //add this condition, in case the number is not 0 OR 1
		cout<<"Invalid entry!!"<<endl<<endl;
	//break; NO BREAK NEEDED
	}while(number!=0);
Yeah that worked! Thanks..


Can someone check what's up with the 102 errors all of a sudden !!?????
which 102 errors?
Ah.. I changed lots of stuff..
Can someone check these links and tell me what I should do?? ! I'm literally depressed now because of it. Whenever I do something it is wrong.

I still didn't wrote the security menu..
But for now this is it.

The main loop IS my major problem i don't know how to do it.


Interface for MainMenu:
http://paste.uni.cc/20464 <<< the private part is empty. I don't know what to put!!!
Implementation for the MainMenu:
http://paste.uni.cc/20465

Interface for Passenger menu:
http://paste.uni.cc/20466
implementation for passenger menu:
http://paste.uni.cc/20467

This is the main()
http://paste.uni.cc/20468 << Not complete and the loop is wrong but it's just the beinning.

Note that there's the security menu.. I'd do it the last thing.
I haven't checked your links but unless a program is quite large in size, 102 erroros probably means you're doing the same thing over and over again, one error is causing the convsecutive errors.

Can you name some of the errors along with the file it is associated with?
Topic archived. No new replies allowed.
Pages: 12