Draw a pentagon (with a loop)

Challenge Level: Growing experience

Learning outcomes

Students will be able to:

Requirement:

Write a program that draws a pentagon (5 sides polygon), starting from point x:0, y:0, with its sides equal to 100 steps. You must use a repeat loop for this challenge.

Testing examples:

There are no testing examples for this challenge.

Languages

Scratch

What it should look like

Click on the green flag to see the expected output of your program.

Recommended blocks
whenclicked
clearpendownpenup
gotox:0y:0move100stepsturn72degrees
wait1secsrepeat5
Hints
  • A pentagon has five equal sides and five equal angles.
  • Block waitsecs waits specified number of seconds, then continues with next block. To be able to see each sides of the pentagon being drawn, use the wait block after turning each angle.

Show Scratch solution

Extra Challenge

Extra challenge #1: Write a program that takes the length of a side of a pentagon as the input, draws the pentagon with the given side and displays its perimeter as the output.