Question: Similar to the problems above, you will use nested loops to recreate the shape below. You will need three variables: one will count the number
Similar to the problems above, you will use nested loops to recreate the shape below. You will need three variables: one will count the number if sides drawn with each shape (starts at 0), one will be the length of each side (starts at 10), and one will be the number of degrees turned (starts at 0). Declare them and initilaize them with starting values. The inner loop should draw a pentagon (5 sides with 5 angles of 72 degrees each). Remember, the side counter and the side length should both be variables. Next, you will nest that loop inside a loop that runs until the degrees variable hits 270. With each iteration of the loop, you will need reset the variable that counts the number of sides back to 0, increment the variable for the side length by 2, and increment the degree variable by 5.
(
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
