
CMU CS Academy 2.2.4 and 2.2.5
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Easy
Maria Cruz Farooqi
Used 3+ times
FREE Resource
2 Slides • 10 Questions
1
CMU CS Academy 2.2.4 and 2.2.5
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
Your Turn: Go to CMU CS Academy and finish the lessons, Checkpoints, and Exercises.
CMU CS Academy 2.2.4 and 2.2.5
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
10 questions
Puns and Oxymorons
Presentation
•
9th - 12th Grade
10 questions
Writing Equations for Exponential Functions
Presentation
•
9th - 12th Grade
10 questions
Future Tense - Spanish
Presentation
•
9th - 12th Grade
10 questions
Writing Piecewise Functions from Graphs
Presentation
•
9th - 12th Grade
8 questions
Text Formatting
Presentation
•
9th - 12th Grade
10 questions
Function Notation Lesson
Presentation
•
9th - 12th Grade
8 questions
HTML Links
Presentation
•
9th - 12th Grade
8 questions
Triangle Congruence Review
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Factors 4th grade
Quiz
•
4th Grade
10 questions
Cinco de Mayo Trivia Questions
Interactive video
•
3rd - 5th Grade
13 questions
Cinco de mayo
Interactive video
•
6th - 8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
Discover more resources for Computers
45 questions
AP CSP Exam Review
Quiz
•
9th - 12th Grade
50 questions
AP CSP Review
Quiz
•
9th - 12th Grade
17 questions
CSP Robot Questions Review
Quiz
•
10th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
50 questions
IBT Final Exam Review (Spring)
Quiz
•
9th - 12th Grade