Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started