Skip to main content

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 5

Term 1 · Algorithms, programs and testing

Lists, loops and summaries

A list groups related values, and a loop applies a rule across entries. The same counting or filtering algorithm can summarize different subjects when the interface and assumptions match.

Read-aloud is not available in this browser. You can still read this text on screen.

Computing lab

Predict the total for the starter. Change it to count scores of 3 or higher, then reuse the counting process for a supplied or fictional daily reading data set. Compare named list operations with a loop for readability.

Keep for review. Two executions with empty-list and boundary tests, plus an explanation of how the rule transferred.

JavaScript starter code

Save this example as a .js file and run it in Node.js or an editor your educator approves.

const scores = [4, 2, 3];
let total = 0;
for (const score of scores) {
  total += score;
}
console.log(total);
What advantage does a loop provide when the number of observations changes?
Plan the week
  1. Read the lesson and explain its main idea in your own words.
  2. State the system or program’s goal and sketch its inputs, rules and output.
  3. Complete the investigation and keep the evidence listed above.
  4. Test or trace a second case and record any change it suggests.
  5. Answer the week’s check, then explain your reasoning using your evidence.

Keep your practice projects local or share them with an approved reviewer. Use fictional or nonpersonal data in your programs and tests.

Academy curriculum for family use. Course credit is subject to school and educator approval.

Quest progressProgress recorded