Problem Solving
Work in teams to write an algorithm, in English, for the following problems. Then, together, write a program to implement your algorithm.
- Triangle
Using Python's Turtle, draw an equilateral triangle. An equilateral triangle is one with all three sides of equal length and all three angles equal to 60 degrees. Your turtle should start at one vertex of the triangle and finish at the same point, pointing in the same direction as it started. Using a variable to represent the length of the sides, your algorithm should be able to draw a triangle of any size.
- Pentagon
Using Python's Turtle, draw a pentagon. A pentagon has five sides of equal length. Your turtle should start at one vertex of the pentagon and finish at the same point, pointing in the same direction as it started. Using a variable to represent the length of the sides, your algorithm should be able to draw a pentagon of any size.
- Polygon
Using Python's Turtle, draw an regular polygon. A regular polygon is an N-sided shape in which the sides are all the same length and the angles between any two sides are the same. For example, an equilateral triangle and a square are regular 3- and 4-polygons, respectively. Your turtle should start at one vertex of the polygon and finish at the same point, pointing in the same direction as it started. Using two variables, one to represent the length of the sides and one the number of sides, your algorithm should be able to draw any regular polygon of any size.