Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loops (if, while)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hey,

I am at a complete block in how to do this assignment. If someone could give me a good stepping stone on how to start this, it would be *greatly* appreciated:

For this lab you are to use loops to draw a 4 x 4 grid on the screen. In addition, you must also change the color of each square in the grid based on what iteration of the loop you are in. For example you might select Color.red if you are in row 2, column 3. This will require either the use of a series of if statements, a switch / if combination, or the use of nested switch statements (nested switches are complex but you learn a lot). I understand that there is an easier way to do this but nested if, switch or a combination of the two is required for this lab.

This lab will require the use of a nested looping structure to display the grid.

Each colored square in the grid must be bordered by a black line.

Each colored square in the grid must be at least 25 pixels tall and 25 pixels wide.

This lab requires the use of either if statements, switch statements, or a combination of the two, to determine what color to draw a grid square based on the row and column in which the square is to be drawn.

Thank you!
 
looks like a copy/paste right from the teachers assignment page!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top