error C2062: type 'void' unexpected

Hey guys, I looked around a bit on google for a way to fix this error, but came up with nothing so I figured I'd ask some people that know what they're talking about (that's you).

So once again, the error is "error C2062: type 'int' unexpected", and it has something to do with the 'heat' function.
If anyone knows how to fix this, It would be a great help.

Edit: Sorry, made it all code format



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
void physics();
	void light();
	void sound();
	void heat();



void physics()
{
	int num;
	cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nDo ALL the physics!\n";
	cout << "1. Light\n";
	cout << "2. Sound\n";
	cout << "3. Heat\n";
	cout << "4. Back\n";
	cout << "5. Exit\n";
	cout << "Enter your choice: ";
	cin >> num;

	switch(num)
	{
		case 1:
			light();
		case 2:
			sound();
		case 3:
			heat();
		case 4: 
			main();
		case 5:
			menu = 4;
		default:
			cout << "That is not a valid entry, you will now return   to the main menu.";
	
	}

}






void heat()
{
	double Q, m, c, Tf, Ti;
	int num, choice;
	cout << "Enter the equation you want to solve\n";
	cout << "1. Q = mc(tf - ti)\n";
	cout << "2. Q = mLv or mLf\n";
	cin >> num;
	
	while(num = 1)
	{
		cout << "Remember, this equation is: Energy = Mass(Specific Heat)(Final Temp - Initial Temp)\n";
		cout << "What are you solving for?\n";
		cout << "1. Q\n";
		cout << "1. m\n";
		cout << "1. c\n";
		cout << "1. Tf\n";
		cout << "1. Ti\n";
		cin >> choice;
		
		switch(choice)
		{
			case 1:
			{
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << "Q = " << m << "(" << c << ")(" << Tf << " - " << Ti << ")";
				cout << "Q = " << m * c * (Tf - Ti);
			}
			case 2:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << "m(" << c << ")(" << Tf << " - " << Ti << ")";
				cout << "m = " << (Q / (c * (Tf - Ti)));
			}
			case 3:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << m << "(c)(" << Tf << " - " << Ti << ")";
				cout << "c = " << (Q / (m * (Tf - Ti)));
			}
			case 4:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << m << "(" << c << ")(Tf - " << Ti << ")";
				cout << "Tf = " << (Q - (m * c * Ti  )) / ( m * c);
			}
			case 5:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << Q << " = " << m << "(" << c << ")(" << Tf << " - Ti)";
				cout << "Ti = " << (Q- (m * c * Tf)) / -( m * c);
			}
			default:
				cout << "You did not enter a valid entry, you will now return to the menu.\n";
		}
	}
	while(num = 2)
	{
		
		cout << "Remember, this equation is: Energy = Mass * Heat of Fusion/Vaporization.\n";
		cout << "What are you solving for?\n";
		cout << "1. Q\n";
		cout << "2. m\n";
		cout << "3. Lf/Lv\n";
		int choice;
		cin >> choice;
		double Q, m, L;
		
		switch(choice)
		{
			case 1:
			{
				cout << "What is m? ";
				cin >> m;
				cout << "What is Lf/Lv? ";
				cin >> L;
				cout << "Q = " << m << "(" << L << ")";
				cout << "Q = " << m * L;
			}
			case 2:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is Lf/Lv? ";
				cin >> L;
				cout << Q << " = m" << "(" << L << ")";
				cout << "m = " << Q / L;
			}
			case 3:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << Q << " = " << m << "(L)";
				cout << "Lf/Lv = " << Q * m;
			}
			default:
				cout << "You did not enter a valid entry, you will now return to the menu.\n";
		}
	}
}
Last edited on
It would help if you told us what line the error was on.

Also, this isn't the source of your error, but your while loops probably meant to be while(num == 2) (note: == for comparison, not = for assignment)

EDIT: also, you shouldn't call main. Ever.

And the code you posted compiles fine without any errors for me (assuming 'menu' is properly declared somewhere).
Last edited on
Oh, sorry bout that. Line 44

And thanks for catching that other mistake too.
There's nothing wrong with line 44 or any of the surrounding lines. You shouldn't be getting an error.

Are you sure this is the code that is giving you the error? Did you post code that's different from what you're actually compiling?
So here's all the code. I'm not really sure why anything other then what I posted earlier would cause the error because it really doesn't interact with 'heat' at all, though I dont really know what to look for to fix this error.

Error on line 290 of the second part

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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
using namespace std;

int menu;
//Function prototypes for menu's and things
void math();
	void derivatives();
	void trigonometry();
	void geometry();
void physics();
	void light();
	void sound();
	void heat();
void fun();
	void displayLoop();
	void music();
	void madLib();



//The main menu, calls other categories
int main()
{
	int num;

	do
	{
		if(menu == 4)
			return 0;
	
		cout << "This is what you can do bro!\n";
		cout << "1. Math Stuff\n";
		cout << "2. Physics Stuff\n";
		cout << "3. Fun Stuff\n";
		cout << "4. Exit\n";
		cout << "Enter your choice: ";
		cin >> num;
		switch(num)
		{
			case 1:
				math();
				break;
			case 2:
				physics();
				break;
			case 3:
				fun();
				break;
			case 4:
				return 0;
			default:
				cout << "That is not a valid entry. Enter a valid number.\n";
		}
	}while(num != 1 || num != 2 || num != 3 || num != 4);

	cin.get();
	return 0;
}

//Function that performs math things
void math()
{
	int num;
	cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nHave fun with the math stuffs dood!\n";
	cout << "1. Derivatives\n";
	cout << "2. Trigonometry\n";
	cout << "3. Geometry\n";
	cout << "4. Back\n";
	cout << "5. Exit\n";
	cout << "Enter your choice: ";
	cin >> num;

	switch(num)
	{
		case 1:
			derivatives();
			break;
		case 2:
			trigonometry();
			break;
		case 3:
			geometry();
			break;
		case 4:
			math();
			break;
		case 5:
			menu = 4;
			break;
		default:
			cout << "That is not a valid entry, you will now return to the main menu.";

	}	

}
//Function that performs physics things
void physics()
{
	int num;
	cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nDo ALL the physics!\n";
	cout << "1. Light\n";
	cout << "2. Sound\n";
	cout << "3. Heat\n";
	cout << "4. Back\n";
	cout << "5. Exit\n";
	cout << "Enter your choice: ";
	cin >> num;

	switch(num)
	{
		case 1:
			light();
		case 2:
			sound();
		case 3:
			heat();
		case 4: 
			main();
		case 5:
			menu = 4;
		default:
			cout << "That is not a valid entry, you will now return to the main menu.";
	
	}

}
//function that performs "fun" things
void fun()
{
	int num;
	cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWoot fun stuff!\n";
	cout << "1. Ooooh pretty loop...\n";
	cout << "2. Ooooh pretty sound...\n";
	cout << "3. The ____ went to the ____ with the ____ and ____ed (Mad Lib)\n";
	cout << "4. Back\n";
	cout << "5. Exit\n";
	cout << "Enter your choice: ";
	cin >> num;

	switch(num)
	{
		case 1:
			displayLoop();
		case 2:
			music();
		case 3:                                     
			madLib();
		case 4:
			main();
		case 5:
			menu = 4;
		default:
			{
				cout << "That is not a valid entry, you will now return to the main menu.";
				main();
			}
	}

}
//Subcategory of Math function that finds derivatives
void derivative()
{
	char test;
	int num, a, n;
	cout << "Note: Will only display custom derivatives in the form of ax^n\n";
	cout << "1. Derivatives of ax^n\n";
	cout << "2. Exponential/Logarithmic derivatives\n";
	cout << "3. Triginometrical derivatives\n";
	cout << "4. Inverse derivatives\n";
	cout << "5. Back\n";
	cout << "6. Exit\n";
	cout << "Enter your choice: ";
	cin >> num;

	while(num == 1)
	{
		do
		{
			cout << "For the equation ax^n, enter in the values requested.\n";
			cout << "Enter a: ";
			cin >> a;
			cout << "Enter n: ";
			cin >> n;
			cout << "The derivative of " << a << "x^" << n << " is: ";
			cout << a * n << "x^" << n - 1 << "\n\n";
			cout << "Repeat? Y/N: ";
			cin >> test;
		}while (test != 'y' || test != 'Y');
	}
	while(num == 2)
	{
		cout << "The derivative of e^x is e^x\n";
		cout << "The derivative of lnx is 1/x\n";
		cout << "The derivative of log(a)x is lna - lnx\n";
	}
	while(num == 3)
	{
		cout << "The derivative of sinx is cosx\n";
		cout << "The derivative of tanx is (secx)^2\n";
		cout << "The derivative of secx is tanxsecx\n";
		cout << "The derivative of cosx is -sinx\n";
		cout << "The derivative of cotx is (cscx)^2\n";
		cout << "The derivative of cscx is cotxcscx\n";
	}
	while(num == 4)
	{
		cout << "The equation for the three primary functions are:\n";
		cout << "The derivative of (sinx)^-1 is:  1 / (1 - x^2)^(1/2)\n";
		cout << "The derivative of (tanx)^-1 is:  1 / 1 + x^2\n";
		cout << "The derivative of (secx)^-1 is:  1 / x((x^2) - 1)^(1/2)\n\n";
		
		cout << "The equation for the three secondary functions are:\n(3.14/2) - (corresponding primary^-1)x\n";
		cout << "The derivative of (cosx)^-1 is:  (3.14 / 2) - (1 / (1 - x^2)^(1/2))\n";
		cout << "The derivative of (cotx)^-1 is:  (3.14 / 2) - (1 / 1 + x^2)\n";
		cout << "The derivative of (cscx)^-1 is:  (3.14 / 2) - (1 / x((x^2) - 1)^(1/2))\n";
	}
	if(num == 5)
		cout << "You will now be returned to the main menu";
	if(num == 6)
		menu = 4;
	if(num != 1 || num != 2 || num != 3 || num != 4 || num != 5 || num != 6)
		cout << "You did not enter one of the options. You will now be returned to the main menu.\n";

}
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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
//subcategory of Math function that does trigonometry
void trigonometry()
{
	int choice;
	do
	{
		cout << "Enter what you want to do.\n";
		cout << "1. sin\n";
		cout << "2. cos\n";
		cout << "3. tan\n";
		cout << "4. arcsin\n";
		cout << "5. arccos\n";
		cout << "6. arctan\n";
		cout << "7. Back\n";

		cin >> choice;
		
		switch(choice)
		{
			case 1:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "sin(" << x << ") is: " << sin(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "sin(" << radians << ") is: " << sin(radians);
						}
					}
				break;
			}
			case 2:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "cos(" << x << ") is: " << cos(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "cos(" << radians << ") is: " << cos(radians);
						}
					}
				break;
			}
			case 3:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "tan(" << x << ") is: " << tan(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "tan(" << radians << ") is: " << tan(radians);
						}
					}
				break;
			}
			case 4:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "arcsin(" << x << ") is: " << asin(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "arcsin(" << radians << ") is: " << asin(radians);
						}
					}
				break;
			}
			case 5:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "arccos(" << x << ") is: " << acos(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "arccos(" << radians << ") is: " << acos(radians);
						}
					}
				break;
			}
			case 6:
			{
				cout << "Is your angle in radians or degrees?\n";
				cout << "1. Radians\n";
				cout << "2. Degrees\n";
				int choice2;
				cin >> choice2;
					switch(choice2)
					{
						long double x;
						case 1:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							cout << "arctan(" << x << ") is: " << atan(x);
						}
						case 2:
						{
							cout << "Enter the value of x: ";
							cin >> x;
							long double radians;
							radians = x * 3.14159265;
							cout << x << " in radians is: " << radians;
							cout << "arctan(" << radians << ") is: " << atan(radians);
						}
					}
				break;
			}

	}while(choice != 7);
	if(choice = 7)
		cout << "You will now return to the main menu.";

}
void geometry()
{
	cout << "Enter what you want to solve for.\n";
	cout << "1. Volume of a cylinder\n";
	cout << "2. Area of a cylinder\n";
	cout << "3. Volume of a sphere\n";
	cout << "4. Area of a sphere\n";
	cout << "5. Volume of a cone\n";
	cout << "6. Area of a cone\n";
	cout << "7. Volume of a pyramid(4 sided)\n";
	cout << "8. Area of a pyramid(4 sided)\n";
	int choice;
	cin >> choice;

	switch(choice)
	{
		case 1:
		{
			double r, h;
			cout << "What is the radius: ";
			cin >> r;
			cout << "What is the height: ";
			cin >> h;
			cout << "The volume of the cylinder is: " << pow(r, 2) * h * 3.1415926;
		}
		case 2:
		{
			double r, h;
			cout << "What is the radius: ";
			cin >> r;
			cout << "What is the height: ";
			cin >> h;
			cout << "The area of the cylinder is: " << 2 * r * 3.1415926 * h;
		}
		case 3:
		{
			double r;
			cout << "What is the radius: ";
			cin >> r;
			cout << "The volume of the sphere is: " << (4/3) * pow(r, 3) * 3.1415926;
		}
		case 4:
		{
			double r;
			cout << "What is the radius: ";
			cin >> r;
			cout << "The area of the sphere is: " << 4 * pow(r, 2) * 3.1415926;
		}
		case 5:
		{
			double r, h;
			cout << "What is the radius: ";
			cin >> r;
			cout << "What is the height: ";
			cin >> h;
			cout << "The volume of the cone is: " << (1/3) * pow(r, 2) * h * 3.1415926;
		}
		case 6:
		{
			double r, l;
			cout << "What is the radius: ";
			cin >> r;
			cout << "What is the side length: ";
			cin >> h;
			cout << "The area of the cone is: " << (pow(r, 2) * 3.1415926) + (3.1416926 * r * l);
		}
		case 7:
		{
			double r, h;
			cout << "What is the side length: ";
			cin >> r;
			cout << "What is the height: ";
			cin >> h;
			cout << "The volume of the pyramid is: " << (1/3) * pow(r, 2) * h;
		}
		case 8:
		{
			double r, h;
			cout << "What is the side length: ";
			cin >> r;
			cout << "What is the slant height: ";
			cin >> h;
			cout << "The area of the pyramid is: " << pow(r, 2) + h * (4 * r );
		}
	}
}
//void light()
//{
//	cout << "
//}
//void sound()
//{
//	cout << "
//}


void heat()
{
	double Q, m, c, Tf, Ti;
	int num, choice;
	cout << "Enter the equation you want to solve\n";
	cout << "1. Q = mc(tf - ti)\n";
	cout << "2. Q = mLv or mLf\n";
	cin >> num;
	
	while(num == 1)
	{
		cout << "Remember, this equation is: Energy = Mass(Specific Heat)(Final Temp - Initial Temp)\n";
		cout << "What are you solving for?\n";
		cout << "1. Q\n";
		cout << "1. m\n";
		cout << "1. c\n";
		cout << "1. Tf\n";
		cout << "1. Ti\n";
		cin >> choice;
		
		switch(choice)
		{
			case 1:
			{
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << "Q = " << m << "(" << c << ")(" << Tf << " - " << Ti << ")";
				cout << "Q = " << m * c * (Tf - Ti);
			}
			case 2:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << "m(" << c << ")(" << Tf << " - " << Ti << ")";
				cout << "m = " << (Q / (c * (Tf - Ti)));
			}
			case 3:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << m << "(c)(" << Tf << " - " << Ti << ")";
				cout << "c = " << (Q / (m * (Tf - Ti)));
			}
			case 4:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Ti? ";
				cin >> Ti;
				cout << Q << " = " << m << "(" << c << ")(Tf - " << Ti << ")";
				cout << "Tf = " << (Q - (m * c * Ti  )) / ( m * c);
			}
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
			case 5:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << "What is c? ";
				cin >> c;
				cout << "What is Tf? ";
				cin >> Tf;
				cout << Q << " = " << m << "(" << c << ")(" << Tf << " - Ti)";
				cout << "Ti = " << (Q- (m * c * Tf)) / -( m * c);
			}
			default:
				cout << "You did not enter a valid entry, you will now return to the menu.\n";
		}
	}
	while(num == 2)
	{
		
		cout << "Remember, this equation is: Energy = Mass * Heat of Fusion/Vaporization.\n";
		cout << "What are you solving for?\n";
		cout << "1. Q\n";
		cout << "2. m\n";
		cout << "3. Lf/Lv\n";
		int choice;
		cin >> choice;
		double Q, m, L;
		
		switch(choice)
		{
			case 1:
			{
				cout << "What is m? ";
				cin >> m;
				cout << "What is Lf/Lv? ";
				cin >> L;
				cout << "Q = " << m << "(" << L << ")";
				cout << "Q = " << m * L;
			}
			case 2:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is Lf/Lv? ";
				cin >> L;
				cout << Q << " = m" << "(" << L << ")";
				cout << "m = " << Q / L;
			}
			case 3:
			{
				cout << "What is Q? ";
				cin >> Q;
				cout << "What is m? ";
				cin >> m;
				cout << Q << " = " << m << "(L)";
				cout << "Lf/Lv = " << Q * m;
			}
			default:
				cout << "You did not enter a valid entry, you will now return to the menu.\n";
		}
	}
}
//void madLib()
//{
//	char noun[10], adjective[15], verb[15];
//	cout << "Enter
//
// 
There are a few things in there that I just caught - breaks and some mis named variables but that's all stuff that I just added and fixed. So when I try to compile now, these are the errors that I get

error C2062: type 'void' unexpected - line 194 part 2
error C2143: syntax error : missing ';' before '{' - line 195 part 2
error C2601: 'heat' : local function definitions are illegal - line 290 part 2
this line contains a '{' which has not yet been matched - line 3 part 2
fatal error C1075: end of file found before the left brace '{' at 'Cornejo_Tanner Final.cpp(230)' was matched - line 1 part 1 (This one I've been getting for a while, and it doesnt make sense. At first it pointed me to the end of the program, then up there to the top. I dont get why it points to the preprocessor stuff)
Last edited on
Looks like the big switch in trigonometry() is missing the ending }.
Aha, well that fixed all of the other problems, or at least they arent showing up in the debug at the moment, but now I have these problems:

1
2
3
4
5
6
7
error LNK2019: unresolved external symbol "void __cdecl derivatives(void)" (?derivatives@@YAXXZ) referenced in function "void __cdecl math(void)" (?math@@YAXXZ)
error LNK2019: unresolved external symbol "void __cdecl sound(void)" (?sound@@YAXXZ) referenced in function "void __cdecl physics(void)" (?physics@@YAXXZ)
error LNK2019: unresolved external symbol "void __cdecl light(void)" (?light@@YAXXZ) referenced in function "void __cdecl physics(void)" (?physics@@YAXXZ)
error LNK2019: unresolved external symbol "void __cdecl madLib(void)" (?madLib@@YAXXZ) referenced in function "void __cdecl fun(void)" (?fun@@YAXXZ)
error LNK2019: unresolved external symbol "void __cdecl music(void)" (?music@@YAXXZ) referenced in function "void __cdecl fun(void)" (?fun@@YAXXZ)
error LNK2019: unresolved external symbol "void __cdecl displayLoop(void)" (?displayLoop@@YAXXZ) referenced in function "void __cdecl fun(void)" (?fun@@YAXXZ)
fatal error LNK1120: 6 unresolved externals


I was getting these earlier int he week and was totally clueless on how to fix them.
Last edited on
The definitions of sound, light, madLib, music and displayLoop are missing.

The definition of derivative should probably be called derivatives because that is the name you have used in the rest of the code.
Last edited on
Ooooh I see what I did wrong. Fixed it and it works. Thanks a ton dude, you're a lifesaver.
Topic archived. No new replies allowed.