HELP!!!

Hi,
I am trying to create a simple text based game for my college work and i cannot get it to work. When i run it tells me it "expected 'while', on the very last line of the code. but i already have one. thanks for any help.

Code:
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
165
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
	string Leader, Pilot, Marksman, Medic, Ship;
	string Trooper_Helmet, Kryptonite, Lian_Yu_Reply;
	int PlanetChoice, Krypton, Lian_Yu, Pandora;
	int Strength = 5, Intelligence = 5, Health = 50, Respect = 5, Armour = 5;
	int BanditHP = 20;

	cout << "Welcome to ________\n\n";
	cout << "What is your last name:  ";
	cin >> Leader;
	cout << "\n\nYou are Captain " << Leader << ", you and your team are criminals that have been ";
	cout << "outcasted by the goverment for rebelling and commiting treason to your planet ";
	cout << "so in result of this you were forced to live on the outskirts of the galaxy in ";
	cout << "your own ship, taking any job that paid.\n\n";
	cout << "Please select the names of your team mates\n";
	cout << "The name of your Pilot?:  \n\n";
	cin >> Pilot;
	cout << "The name of your Marksman?:  \n\n";
	cin >> Marksman;
	cout << "The name of your Medic?:  \n\n";
	cin >> Medic;
	cout << "What is the name of your ship?:  \n\n";
	cin >> Ship;
	cout << "What Planet would you like to visit:  \n\n";
	cout << "1 - Krypton\n" << "2 - Lian Yu\n" << "3 - Pandora\n";
	do{
		cout << "What Planet would you like to visit?\n"
			<< "1 - Krypton"
			<< "2 - Lian Yu"
			<< "3 - Pandora"
			<< "4 - Collect Bounty (Must have done at least one of the planets.)";
		cin >> PlanetChoice;
		cout << "\n";

		switch (PlanetChoice)

		{
		case 1:
			cout << "This planet has been uninhabitated for thousand of years due to an ancient war ";
			cout << "between two families, however due to this planet being uninhabitated for this ";
			cout << "long, it is very difficult to predict.\n\n";
			cout << "Your Mission is to collect some Kryptonite for Mr. Luthor";
			cout << "You find a helmet that belongs to a goverment trooper, Would you like to equip it";
			cin >> Trooper_Helmet;
			cout << "/n";
			if (Trooper_Helmet == "yes")

			{
				Armour += 2;
				Respect -= 1;

				cout << "You have equipped the tropper helmet./n"
					<< "Your Armour has been increased by 2/n"
					<< "Your crew are disgusted that you would wear goverment equipment"
					<< "You lose 1 respect/n";

			}
			else
			{
				cout << "You choose to ignore the helmet and continue carefully/n/n";
			}
			cout << "You continue onwards and approach what looks like a crater"
				<< "You climb to the top of the crater so you can see inside"
				<< "In the middle of the crater there is freshly mined Kryptonite"
				<< "Take the Kryptonite, Or abort in case of trap?";
			cin >> Kryptonite;
			cout << "/n";
			if (Kryptonite == "take")

			{
				Respect += 3;

				cout << "You have obtained the kryptonite"
					<< "Your team respect you for taking a risk"
					<< "to obtain the item."
					<< "Your respect is now " << Respect << ".";
			}
			else
			{
				cout << "You return back to " << Ship << " decide the next plan of action";
			}

			break;


		case 2:
			cout << "Lian Yu is a small planet with very little civilisation";
			cout << "Your objective is to find and eliminate are target who";
			cout << " goes by the name of Yao Fei, who is extremely dangerous";
			cout << "with a bow and should be taken lightly";
			cout << "/n/n";
			cout << "After you land and suit up, you start to move through"
				<< " some woodland terrain, after a few minutes of walking"
				<< " you hear a voice shout 'Turn back now and no one gets hurt'";
			if (Lian_Yu_Reply == "reply")
			{
				cout << " You : ' Show yourself and we will kill you quickly '"
					<< " Yao Fei : ' Final Warning, leave or die '"
					<< " You : ' 3 of us and only one of you '"
					<< " As soon as these words leave your mouth an arrow flies"
					<< " through the woods and buries itself deep into your medics"
					<< " throat"
					<< " Yao Fei : ' Wrong, theres only two of you '"
					<< " " << Medic << " has been killed your strength goes down"
					<< " Yao Fei : ' I do not wish to kill anymore of you however '"
					<< "			' If you do not leave i will '"
					<< " As he is saying this you spot him in a tree about 30 yards away"
					<< "You signal" << Marksman << " to take the shot."
					<< Marksman << " then brings up his rifle and shoots him out of the tree"
					<< "After " << Leader << " confirms the kill you stop and pay your"
					<< " respects to " << Medic << " and return back to the ship";
				break;


		case 3:
			cout << "You land on the planet that goes by the name of 'Pandora'"
				<< "As your doors open you see a group of bandits approaching"
				<< " with weapons"
				<< Leader << ": ' Drop the weapons or we will drop you"
				<< "Bandit: ' I believe you came here for this"
				<< "He says whilst holding up a hard drive"
				<< Leader << ": ' How did you know? Hand it over"
				<< "Bandit: Sorry cant do that"
				<< "				FIGHT						"
				<< "\nYou draw your pistol and open fire doing 5 damage";
			BanditHP -= 5;
			cout << "Bandit Health: " << BanditHP << "\n\n";
			cout << "The Bandit returns fire doing 10 damage";
			Health -= 10;
			cout << "Your Health is now: " << Health << "\n\n";
			cout << "You hit the bandit again dealing 7 Damage";
			BanditHP -= 7;
			cout << "Bandit Health: " << BanditHP << "\n\n";
			cout << "The Bandit throws form of explosive, doing 25 damage";
			Health -= 25;
			cout << "Your Health is now: " << Health << "\n\n";
			cout << "You stand up and fire the last bullet from your magazine";
			cout << " which enters the bandits eye socket and deals 20 damage";
			cout << "Bandit Health: " << BanditHP << "\n\n";
			cout << "You know limp back to " << Ship << " with the hard drive";
			break;


		case 4:
			cout << "You board your ship";

		default:
			cout << "Incorrect input, please try again";

			}
		}while (PlanetChoice != 4);

		cout << "You re-assemble your team and travel back"
			<< "To your home planet, and collect your bounty";
	

		system("pause");
		return 0;

	}
Last edited on
Please use code tags when posting
http://www.cplusplus.com/articles/z13hAqkS/

you most likely have a missing brace somewhere
Topic archived. No new replies allowed.