Track quiz
Keep this table open beside the editor while you answer.
| Idea | The line to keep |
|---|---|
| Typing it out | A typed program runs one line at a time, from the top. The lines run in the order you wrote them. |
let and const | let can be given a new value later. const cannot. The machine stops the run if you try. |
| Four kinds of value | The kind of a value is what the machine holds. It is not how the writing looks. Run it and ask: number, text, true or false, or nothing? |
| What the signs do | The signs do arithmetic on two numbers. + joins instead when one side is text. The other side must be something that can be written out. A nothing cannot be written out. In this editor, text plus nothing stops the run. |
| A fork in the line | An if runs its block only when the condition is true. In this editor, the condition must be true or false. A number or text there stops the run. |
| Until it stops | while checks its condition, runs the block, and checks again. Something inside the block must change what the condition asks about. Otherwise nothing ever ends it. |
| Once for each | for (const item of list) runs once per item. The number of turns comes from the list, not the block. |
| What the message says | An error message names the line the run stopped on. It says what could not be done there. The cause can be on that line or above it. Fix one thing, then run it again. |
Two print lines are swapped. What changes?
What do the quote marks in print("Canal Bridge"); do?
Which word makes a box you can refill later?
const seats = 32; and later seats = 40;. What happens?
waiting holds 18. Then waiting = waiting + 6; runs. What does it hold?
What does "12" + 8 give?
What kind of value is "true"?
What does 45 * 3 + 12 give?
In this editor, what does "Total: " + chalk do when chalk holds nothing?
mm is 60. What does mm >= 60 give?
In this editor, a learner writes if (mm) { ... } and mm is a number. What happens?
A queue of 96 halves each round until it is under 10. How many rounds?
A while loop starts with a true condition. Its block never changes what the condition asks about. What happens?
A list holds 3 stops. How many turns does for (const stop of stops) take?
The list is empty. How many times does the block run?
An error message says line 3. What do you do first?
That is the track: type it, run it, read what comes back.
Next: Computational Thinking III: Functions & Debugging.