In coding, what does REPEAT mean?
Do the same steps again.
What does SET score = 0 mean?
Create/store a variable named score with value 0.
hat does an operation do in code?
Performs math/calculations on values.
What is a function in coding (in simple terms)?
A named recipe of steps you can reuse.
A condition in coding has only two possible results. What are they?
True / False.
If you REPEAT 4 times and each time you add 2 points, how many points total did you add?
8.
If coins = 3 and you pick up 2 more, what is coins now?
If x = 10 then you do x = x - 4, what is x now?
Why use a function instead of rewriting the same steps in 5 places?
Saves time, reduces mistakes, easier to edit.
IF the rule is “level ≥ 5” and the level is 3, does the IF part run?
No.
A loop is best for which job: (A) storing a name, (B) repeating a step 10 times, (C) checking a rule once?
B.
hich is a better variable name for “how many lives left”: (A) x, (B) l, (C) livesLeft
C
A game gives 3 points per win. You win 6 times. What is your total?
18.
A function called double takes an input number and outputs twice it. If the input is 7, what is the output?
14.
IF score ≥ 10 then “Win” ELSE “Try Again.” If score is 10, what happens?
Win
A loop runs while a rule is true. The rule is “battery > 0.” What should happen to battery inside the loop so it eventually stops?
Battery should decrease (so it reaches 0).
What type of variable stores text inside quotes?
A string
In coding, the “leftover after dividing” is useful for checking even/odd. What are the possible leftovers when dividing by 2?
0 or 1
A function input is often called what?
A parameter (or “input”).
Which rule is stricter: “score > 10” or “score ≥ 10”?
“score > 10” is stricter.
You expected a loop to run 5 times, but it keeps going forever. What kind of bug is this?
An infinite loop.
You want to store a student’s grade level (like 7). Should that variable be String or Int?
Int
You divide 17 cookies among 5 people equally. How many cookies are left over?
2.
What’s the difference between a function that prints an answer and a function that returns an answer?
Print = shows it on screen; Return = gives the value back so the program can use/store it.
A programmer wants a rule that is true when a number is even. What should be true about its leftover when dividing by 2?
0