Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1let lives = 3; // try 5 instead | AKeep a copy of the original line as a comment before you change it | |
| 2// let score = 0; let score = 10; | BChange one small value, then run the program again to see what is different | |
| 3Add a new branch to an existing if statement so the program handles one more case | CThe student ran the program without predicting the result first, so there is nothing to compare against | |
| 4Change a loop's condition, then run it and compare the output with your prediction | Delse if (score >= 50) { console.log("Pass"); } | |
| 5// changed the loop limit, the message AND the score all at once let limit = 10; let msg = "Go!"; let score = 100; | Efor (let i = 0; i < 5; i++) { console.log(i); } | |
| 6let total = 0; total += 5; console.log(total); // I did not predict the output, just ran it | FToo many changes were made at once, so if the program breaks you cannot tell which change caused it |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
predict, change, run — Read the code and predict what it does, change one small part (a value, condition or message), run it, then compare the result with your prediction.// change: repeat 5 times
for (let i = 0; i < 5; i++) {
console.log("Go!");if (score >= 90) { grade = "A"; }
else if (score >= 80) { grade = "B"; }
else { grade = "C"; }let score = 10;
const original = score;
score = 20;// change: 18 year olds can now enter
if (age >= 18) console.log("Enter");let total = 0;
for (let i = 1; i <= 3; i++) total += i;
console.log(total);