00:01
For problem 38, you're going to be revising a program so that it prompts a user to enter the x and y coordinates as well as the width and height for two rectangles, and then determines whether the second rectangle is inside the first or overlaps the first, and then draws the two rectangles and displays the status.
00:26
So this is very similar to the earlier assignment number.
00:37
I'm trying to find it here.
00:43
Problem 28.
00:53
So a lot of this is the same as from problem 28.
00:57
You'll ask the user to input the x, y, with, and height for the two rectangles.
01:03
And to determine the status, you'll use the same.
01:07
Conditionals as you did before.
01:11
The new part is the turtle stuff.
01:13
So we need to import turtle at the beginning.
01:17
I decided to draw the two rectangles before determining what the status was.
01:24
So to draw rectangle one, we'll pick up the pen, go to x1 minus half the width, y one minus half the height, put the pen down, and sort of go around to the four edges of the rectangle to draw the rectangle.
01:38
You'll pick the pen back up and do the same for r2 to draw out rectangle 2.
01:44
And then to display the status, we want to pick up the pen...