Assignment help!!

I have to program a menu with the abillity to go back and select different options. It was working for me until i added case 3 and im not sure why? i dont know if im missing anything or maybe im writting it wrong please help me out.
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	bool quit, back;
	int measurement;
	double data;
	
	do
	{
		cout << "0. Quit\n";
		cout << "1. Length\n";
		cout << "2. Mass\n";
		cout << "3. Velocity\n";
		cout << "4. Force\n";
		cout << "5. Pressure\n"; 
		quit = false;
		cin >> measurement;
	
	switch(measurement)
	{
	
		case 0:
		quit = true;
		break;

	
		case 1:
		
		do
		{
			cout << "0. Back\n";
			cout << "1. Millimeters to inches\n";
			cout << "2. Inches to millimeters\n";
			back = false;
			cin >> measurement;
			switch(measurement)

		{
			case 0:
				back = true;
				break;
		
		
			case 1:
				cout << "Enter a length in Millimeters\n";
				cin >> data;
				data /= 25.4;
				cout << "It equals " << data << "in.\n";
				break;

			case 2:
				cout << "Enter a length in Inches\n";
				cin >> data;
				data *= 25.4;
				cout << "It equals " << data << "mm.\n";
				break;

			default:
				break;
			}
		}while(back != true);
			break;
		
		case 2:
			
			do
			{
				cout << "0. Back\n";
				cout << "1. Kilograms to Pounds\n";
				cout << "2. Pounds to Kilograms\n";
				back = false;
				cin >> measurement;
				switch(measurement)
				{
					case 0:
						back = true;
						break;

					case 1:
						cout <<"Enter a mass in Kilograms\n";
						cin >> data;
						data *= 2.2;
						cout << "It equals " << data << "lbs.\n";
						break;

					case 2:
						cout <<"Enter a mass in Pounds\n";
						cin >> data;
						data /= 2.2;
						cout <<"It equals " << data << "Kg\n";
						break;

					default:
						break;
				}
			}while(back != true);
			break;

		case 3:

			do
			{
				cout <<"0. Back\n";
				cout <<"1. Kilometers per hour to Miles per hour\n";
				cout <<"2. Miles per hour to Kilometers per hour\n";
				back = false;
				cin >> measurement;
				switch(measurement)
				{
					case 0:
						back = true;
						break;

					case 1:
						cout << "Enter a velocity in Kilometers per hour\n";
						cin >> data;
						data /= 1.609;
						cout <<"It equals " << data << "Mph\n";
						break;

					case 2:
						cout << "Enter a velocity in Miles per hour\n";
						cin >> data;
						data *= 1.609;
						cout <<"It equals " << data << "Kph\n";
						break;

					default:
						break;
				}
			}while(back != true);
			break;

				
		case 4:
			do
			{
				cout <<"0. Back\n";
				cout <<"1. Newtons to Pound Force\n";
				cout <<"2. Pound Force to Newtons\n";
				back = false;
				cin >> measurement;
				switch(measurement)
				{
					case 0:
						back = true;
						break;

					case 1:
						cout << "Enter a Force in Newtons\n";
						cin >> data;
						data *= .2248;
						cout <<"It equals " << data << "lbf\n";
						break;

					case 2:
						cout << "Enter a Force in Pounds\n";
						cin >> data;
						data *= 4.448;
						cout <<"It equals " << data << "N\n";
						break;

					default:
						break;
				}
			}while(back != true);
				break;
		case 5:
			do
			{
				cout <<"0. Back\n";
				cout <<"1. Pascal to Pound per square inch\n";
				cout <<"2. Pound per square inches to Pascal\n";
				back = false;
				cin >> measurement;
				switch(measurement)
				{
					case 0:
						back = true;
						break;

					case 1:
						cout << "Enter a Pressure in Pascals\n";
						cin >> data;
						data *= .000145;
						cout <<"It equals " << data << "Psi\n";
						break;

					case 2:
						cout << "Enter a Pressure in Pounds per square inch\n";
						cin >> data;
						data *= 6894.757;
						cout <<"It equals " << data << "Pa\n";
						break;

					default:
						break;
				}
			}while(back != true);
				break;

			}
		}while(quit =! true);



		
	system("pause");
	return 0;
}
Topic archived. No new replies allowed.