Hi all,
I have a very smart student. 1500+ SAT. Better coder than me. He refuses to do the written responses in paragraph format and will not use sentence starters.
Do you think he would get awarded points for this written response for Unit 6 Lesson 8?
This question is based on the project you submitted.
Consider an iteration statement in your program.
• Describe how this iteration statement works.
• Explain how the loop ensures that each icon (e.g., “icon0”, “icon1”, …, “icon19”) gets updated.
Below is his response:
The loop which sets the colours of each icon is as follows:
- Dimensionalizes i and sets it to 0.
- If i is less than 20,
- Calculate the random size.
- Set the position of “icon” + String(i) to a random value. It can go off the screen by size pixels.
- Set the size to the computed size.
- Increment i.
- Go back to Step 2.
The literal “icon” + String(i) gets the ith icon.