Help and very urgent (Graph and Loop)

So basically the code works and everything, but my main problem is how can I put loop so it can show in the graphics 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
#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();
		
		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;
}

void renderScene ()
{
	
}


So for this program, I'm asking the user how many circles and rectangles does the user want to show in the graphics window. My problem is how am I going to do that? Can you put a loop statement in void renderScene and if you can how do you input it. I'm sorry but I'm kind of stressing out from this because this program counts as my final.
Last edited on
So, you wanna know how to actually get the circles and rectangles drawn on the command prompt? That would require a a for loop that loops through a sort of board. You can create an outline of the shape using math. Check where you want to create the border by telling the computer how to get there using subtraction, or addition. There are many examples of how to draw boards and circles online. That's what I'm assuming renderScene() is trying to do. Just output the shapes, using for loops.

If that isn't what you wanted, I'm sorry! I'm also starting out with programming! I could be dead wrong in my reply!
Topic archived. No new replies allowed.