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 2

Term 1 · Algorithms, programs and testing

Bits, characters and color

A sequence of bits has meaning under an encoding. The same bit pattern can represent a number, a text-related value or part of a color. A hexadecimal digit represents four bits.

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

Computing lab

Convert 00001111 to decimal and hexadecimal, then compare the representations of the character A and the red channel in #FF2200. Describe what changes when you change the interpretation without changing the bits.

Keep for review. A conversion table with the encoding or interpretation labeled for each row.

JavaScript starter code

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

console.log(Number.parseInt('00001111', 2));
console.log((15).toString(16));
console.log(new TextEncoder().encode('A')[0]);
console.log(Number.parseInt('FF', 16));
What is the decimal value of binary 00001111 when read as an unsigned integer?
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