Geometric drawing

27 Jan 2025 - 13:40 | Version 1 |

Objectives

  1. Learn to use repetition
  2. Learn to use variables
  3. Reinforce selection skills
  4. Reinforce reading from the brick

Assignment

  1. Create a clean program that will "draw" a 3, 4, or 5 sided figure (with even sides) based on the button from the brick.
    1. If the left button is pressed, draw a triangle (60 degree angle)
    2. If the middle button is pressed, draw a square (90 degree angle)
    3. If the right button is pressed, draw a five sided polygon (approximately 108 degree angle)
  2. Additional requirements
    1. You should use a count controlled loop
    2. You must use at least two variables.
    3. Inside the selection you can only have variables blocks (only one is optimal but not required). No repetition or arithmetic blocks inside the selection
    4. You may only have two instances of motor blocks

Submission instructions

  1. Due date is found on Canvas
  2. Create a pdf document that contains the following information
    1. Your name
    2. A brief description of what you did
    3. How you improved over any mistakes made last time
    4. Indicate which hints (if any) you used
    5. How well you achieve each objective
  3. Submission:
    1. Place code and pdf file into an empty zip folder and submit it.

Hints

  1. The same thing about accuracy in the first lab applies to this one! There is not objective about being accurate!
  2. I can set a variable but using a variable is a problem
  3. Questions about the math should be asked in class. This is not one of the objectives of the assignment! So ask if you need some help on the arithmetic!

Challenges

  1. Make your program very accurate
  2. Have your program move forward and then draw the figure based on a color seen. Let the color pick the number of sides.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine