
U2L1-2 Review ^^
Presentation
•
Computers
•
9th - 10th Grade
•
Medium
TIFFANY WONG
Used 10+ times
FREE Resource
7 Slides • 9 Questions
1
U2L1-2 Review ^^
Presented by kaufwong©
2
Multiple Select
Which of the following are GLOBAL variables? Choose one or more.
3
Global vs. Local Variables
A global variable is one that ALL sprites and scripts can access.
shopping list is a global variable. The sprites "add," "clear," and "delete" all access shopping list and make changes to it.
4
Global vs. Local Variables
A local variable is limited to the scope in which its defined.
In other words, secret number can ONLY be used in the definition of number guessing game.
If you try to use secret number outside of number guessing game, you'll get an error.
5
More on local variables
We use local variables because using global variables sometimes makes it difficult to debug.
Having too many global variables also clutters our variable palette...
So when you're wondering if it should use a global or local variable, ask: do multiple scripts/sprites need to use it??
vs
6
Multiple Select
Which of the following are LOCAL variables? Choose one or more.
7
More on local variables
Yes, input variables are also local!
They cannot be used outside of the procedure in which they are defined.
8
Fill in the Blanks
Type answer...
9
Fill in the Blanks
Type answer...
10
Multiple Select
In which of the following instances should you use global variables instead of local variables? Choose one or more.
Keeping track of a player's score throughout an event-based game with many different triggers
Making an abstraction called "pythagorean thm" that takes in two numbers and calculates the third side
Making an app that manages a to-do list with various sprites as buttons that each have a different feature
Counting the number of times the user makes a guess, but the variable is used only in this script
11
Variables vs Lists
A list can hold more than one value at a time, and the values are ordered. A variable can only hold one value at a time.
Shopping list app is very hard to do with just variables :(
You don't know how many variables you need to create because you need one for every item the user will add (and who knows how many they'll add!). A list is better because it can hold as many values as the user wants to add.
12
Multiple Choice
Running which of the following scripts will result in shopping list being an empty list?
13
Multiple Select
Running which of the following scripts will make the sprite say "0" ? Choose one or more.
14
Multiple Choice
shopping list = [eggs, milk, bread]. Which of the following will make shopping list [eggs, milk, cheese, bread] ?
15
The index of an item in the list refers to its order in the list.
shopping list = [eggs, milk, bread]
The first item, eggs, is at index 1
The length of the list refers to the number of items inside.
We want [eggs, milk, cheese, bread]
add adds items to the end, i.e. append in pseudocode
16
Multiple Choice
The delete blocks takes in a number and a list as inputs. Which of the following scripts will delete bread from the shopping list?
U2L1-2 Review ^^
Presented by kaufwong©
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
9 questions
Area of Parallelograms and Triangles
Presentation
•
9th - 10th Grade
11 questions
Central Angles and Arc Measures
Presentation
•
9th - 10th Grade
10 questions
Kinetic Energy
Presentation
•
9th - 10th Grade
10 questions
Parallel Structure
Presentation
•
9th - 10th Grade
10 questions
Nested Loops
Presentation
•
9th - 10th Grade
15 questions
Visión prospectiva de la tecnología: escenarios deseables.
Presentation
•
9th Grade
13 questions
Cell Cycle
Presentation
•
9th - 10th Grade
10 questions
Coding in Kindergarten 2023
Presentation
•
KG
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
Inventor Terms Exercise #1a
Quiz
•
9th Grade
31 questions
Inventor Vocabulary Review Sheet
Quiz
•
9th Grade
10 questions
Exploring Cybersecurity Techniques and Threats
Interactive video
•
6th - 10th Grade