Search Header Logo
CMU CS Academy Lesson 1.1.2

CMU CS Academy Lesson 1.1.2

Assessment

Interactive Video

Computers

9th - 12th Grade

Easy

Created by

Maria Cruz Farooqi

Used 2+ times

FREE Resource

30 questions

Show all answers

1.

SLIDE QUESTION

30 sec • Ungraded

2.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Media Image

Our First Program

To start, let's draw a rectangle. Press the green (a)   button to run this Python code:

3.

DROPDOWN QUESTION

1 min • 1 pt

To understand what is going on, we first have to talk about the canvas.

In this course, all drawing is done on a canvas. The canvas is made up of tiny colored points, or ​ (a)   . We use ( x , y ) coordinates to talk about pixels on the canvas, like so:

​ (b)   is the left-top corner of the canvas (not the middle!).

As x increases, you head ​ (c)   .

As y increases, you head​ (d)   , not up!

Our canvas is a 400x400 square, so (200, 200) is the middle of the canvas, and ​ (e)   is the right-bottom corner.

pixels
(0, 0)
right
down
(400, 400)

4.

SLIDE QUESTION

30 sec • Ungraded

5.

DROPDOWN QUESTION

1 min • 1 pt

Media Image

Drawing Rectangles

Ok, let's get to the details. Here is the Python code from above:

Rect(10, 20, 30, 40)

We use Rect to draw a ​ (a)   . We provide 4 values after that: left, top, width, and height. So the above code draws a rectangle with its left-top corner at ​ (b)   , a width of ​ (c)   , and a height of ​ (d)   .

rectangle
(10, 20)
30
40

6.

SLIDE QUESTION

30 sec • Ungraded

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Watch video to get answer:

Which rectangle has a right-bottom corner at (100, 150)?

Rect(70, 90, 30, 60)

Rect(70, 90, 150, 100)

Rect(70, 90, 80, 10)

Rect(70, 90, 100, 150)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?