Hello all,
I'm doing this scratch practice:
1. Prompt the user for the number of sides and store this value (numSides)
2. If the number of sides is less than three
a. Output “Sorry, a polygon needs at least three 3 sides!”
Otherwise
b. Compute and store the length of any side of the polygon as
sideLength=(100*360*pi)/(numSides*180)
where you can approximate pi as 3.14159 for this lab
I got all of the above part right but now I'm so stuck on how to do this:
c. Move to the (x,y) coordinate of (-sideLength/2,100)
d. Point to the right (90 degrees)
e. Drop the pen
f. Repeat the following for each side of the polygon
-Move sideLength steps forward
-Turn clockwise by 360/numSides
g. Lift the pen
This practice stuff looks important so any help on it will be appreciated please!
Thanks a lot
Offline