Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

write a program that has tracy draw a rectangle. your rectangle should:…

Question

write a program that has tracy draw a rectangle.
your rectangle should:

  • have a width of 50
  • have a height of 100

tracy should start by drawing the short edge of the rectangle first, and she should end the program facing right.

Explanation:

Step1: Define short/long sides

Short side (width) $w=50$, long side (height) $h=100$

Step2: Draw first short edge

forward(50)

Step3: Turn right 90 degrees

right(90)

Step4: Draw first long edge

forward(100)

Step5: Turn right 90 degrees

right(90)

Step6: Draw second short edge

forward(50)

Step7: Turn right 90 degrees

right(90)

Step8: Draw second long edge

forward(100)

Step9: Turn right to face right

right(90)

Answer:

# Tracy starts facing right by default
forward(50)
right(90)
forward(100)
right(90)
forward(50)
right(90)
forward(100)
right(90)