Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes

I am having trouble in finding the path for hopscotch. I do not quite understand what I have to do?

asked in CSC211_Winter2018 by (1 point)

2 Answers

+10 votes

Think of the pattern in groups of two lines. Since there are an odd number of lines to be printed, either print the 1 before a loop OR print the 10 after the loop.

You can use a for-loop or a while loop, but either way I'd print two lines in the body of the loop. If using a for loop, remember that the loop control variable can be increased by more than 1 each time through the loop by using an assignment statement like i = i + 3 instead of the more common i++ or i--.

answered by (1 point)
+4 votes

I agree with professor Mueller

answered by (1 point)
...