
Grade 12 · 18 weeks
Computer Science
Build and test a Lantern Festival scorer, model data, and design a program that people can use without giving up unnecessary personal information.
Start Week 4Term 1 · Algorithms, programs and testing
Variables, decisions and boundaries
A variable holds a value. A conditional selects behavior based on a test. A boundary case such as equality can reveal whether the implementation matches the requirement.
Read-aloud is not available in this browser. You can still read this text on screen.
Computing lab
Predict the result for scores 9, 10 and 11, then run the starter. Make the threshold configurable and compare an if/else version with an early-return version for the same cases.
Keep for review. Boundary tests and a short explanation of which version is easier to read and why.
JavaScript starter code
Save this example as a .js file and run it in Node.js or an editor your educator approves.
function gateStatus(score) {
if (score >= 10) return 'Open';
return 'Closed';
}
for (const score of [9, 10, 11]) {
console.log(score, gateStatus(score));
}Plan the week
- Read the lesson and explain its main idea in your own words.
- State the system or program’s goal and sketch its inputs, rules and output.
- Complete the investigation and keep the evidence listed above.
- Test or trace a second case and record any change it suggests.
- Answer the week’s check, then explain your reasoning using your evidence.

