
CMU CS Academy 2.2.4 and 2.2.5
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Easy
Maria Cruz Farooqi
Used 4+ times
FREE Resource
2 Slides • 10 Questions
1
Variables and Mouse Release Events
By Maria Cruz Farooqi
Learning Target:
I can identify and utilize global and local variables to modify the properties of a shape in a graphical program.
I can use Python to change shapes when I release the mouse and explain what happens when I press and release the mouse in different ways.
2
Drag and Drop
3
Multiple Choice
How can we be sure that there are 2 circles after we click the mouse in the previous example?
We cannot. There is no way to tell.
The Inspector shows one point with two colors.
Both a red and a blue circle are clearly visible.
The circle is purple, because it combines blue and red.
4
Dropdown
5
Dropdown
See how the circle
6
Dropdown
Unlike local variables, global variables can be used anywhere, inside or outside any function. That is why we can use c inside
7
Multiple Choice
Which variables are local, and which are global, in the previous example?
x and y are local, and c is global.
They are all local.
They are all global.
c is local, and x and y are global.
8
Drag and Drop
onMouseRelease
When you press the mouse down, eventually you stop 9
Dropdown
10
Multiple Choice
In the previous example, what happens if you press the mouse and immediately release it (without moving it)? Try it first before answering.
We get two circles -- a navy circle drawn directly over a gold circle.
The code crashes if we do that.
We get only one circle -- the gold circle becomes navy.
There is no way to tell if we have one or two circles.
11
Dropdown
12
Variables and Mouse Release Events
By Maria Cruz Farooqi
Learning Target:
I can identify and utilize global and local variables to modify the properties of a shape in a graphical program.
I can use Python to change shapes when I release the mouse and explain what happens when I press and release the mouse in different ways.
Show answer
Auto Play
Slide 1 / 12
SLIDE
Similar Resources on Wayground
7 questions
Last Lesson Finale: The AI Guess Who? Game!
Presentation
•
9th - 12th Grade
12 questions
AP Computer Science Principles Procedures
Presentation
•
9th - 12th Grade
10 questions
Decision Making
Presentation
•
9th - 12th Grade
10 questions
Subjuntivo
Presentation
•
9th - 12th Grade
10 questions
Element of Line
Presentation
•
9th - 12th Grade
9 questions
School Website Design Evaluation Modeling
Presentation
•
9th - 12th Grade
9 questions
Second Week
Presentation
•
9th - 12th Grade
11 questions
Camera Angles
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
How much do you know about our Portrait of an Eagle?
Quiz
•
10th Grade
10 questions
Fast Food Slogans
Quiz
•
6th - 8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
[AP CSP] Python Coding: Functions, Parameters, Return
Presentation
•
9th - 12th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade
20 questions
APCS Unit 1A
Quiz
•
9th - 12th Grade
24 questions
Binary
Quiz
•
9th - 12th Grade