Help with graphing and maybe loop.

So for this program, I want to ask the user how many circles and rectangles to be shown in the graphic window.

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
#include "iostream.h"
#include "graphics.h"

int main()
{
	// Variable declaration
	int cir, rec;

	// Greet
	cout << "Welome to the District Assessment!" << endl << endl;
	cout << "How many circles do you want to display? [1-5]";
	cin >> cir;
	
	if (cir <= 0)
		cout << "Error! You must enter 1 through 5. Run again." << endl;
	
	else if (cir <= 5)
	{
		cout << "How many rectangles do you want to display? [1-5]";
		cin >> rec;

		if (rec <= 0)
			cout << "Error! You must enter 1 through 5. Run again." << endl;

		else if (rec <= 5)
		{
			{
			initGraph();
			return 0;
			}

			void renderScene ()
			{
				for (int cir; cir <= 5; ++counter)
				{   
					circle(50, 50, 25);
					
				}
			}
		}
		else 
			cout << "Error! You must enter 1 through 5. Run again." << endl;
	}
	else 
		cout << "Error! You must enter 1 through 5. Run again." << endl;

	return 0;
}



The program is not done but I want to check on it from time to time.

Error-
From Line 25 (error C2601: 'renderScene' : local function definitions are illegal)
Last edited on
Hi,

You are missing a bracket ("}") above void renderScene ()

hope it helps
Topic archived. No new replies allowed.