ATARMAxxing · WACE Year 11 Computer Science revision notes

Programming

Unit 1: Design and development of programming and network solutions · Unit 1 content area: Programming
U1 · Unit 1 content area: Programming

What this note covers

  1. Data representation, data types and operators
  2. Control structures, modules, arrays and files
  3. The development framework, good practice, APIs and the law
  4. Testing and debugging

4 sections · 14 key terms & formulas · 8 common mistakes

Free sample

A computer stores every piece of data as a pattern of bits, and text is no exception. A character set gives each character a numeric code. The computer stores that code, and software turns it back into a symbol when the text is shown. In ASCII, the capital letter A is 65, lower-case a is 97 and the digit character '0' is 48. This is why the character '7' (code 55) is not the same thing as the number 7. Python makes the mapping visible: ord('A') gives 65 and chr(65) gives 'A'. Unicode extends the same idea to more than a million code points, aiming to cover all modern writing systems, most historic ones and symbols such as emoji.

One value can be written in several number bases. Decimal (base 10) has place values 1, 10, 100 and so on. Binary (base 2) has place values 128, 64, 32, 16, 8, 4, 2, 1 across an 8-bit byte. Hexadecimal (base 16) uses the digits 0–9 and A–F, where A = 10 and F = 15. Each hex digit represents exactly four bits (a nibble), so a byte is always two hex digits. To convert binary to hex, split the byte into two nibbles and convert each one separately. Programmers like hex because it is short and maps cleanly onto binary.

Every value in a program has a data type. An integer is a whole number, such as a count of tickets. A float holds a number with a fractional part, such as an average of 72.5. A string holds text, including codes like a postcode '6000' that are never used in arithmetic. A Boolean is True or False, such as whether a fee has been paid. In Python, input() always returns a string, so the value must be converted with int() or float() before any calculation.

Operators act on values. Arithmetic operators are +, -, *, / and % (MOD, the remainder: 17 % 5 = 2). In Python, / always gives a float. Relational operators (==, !=, >, <, >=, <=) compare two values and give a Boolean. Logical operators AND, OR and NOT combine Booleans. The order of precedence is: arithmetic, then relational, then NOT, then AND, then OR. Brackets override this order and make the intent obvious to a reader.

Worked example. Convert 'M' (ASCII 77) to binary and hex. 77 = 64 + 8 + 4 + 1, so the byte is 01001101. The nibbles are 0100 = 4 and 1101 = 13 = D, giving 4D. Check: 4 × 16 + 13 = 77. Next, evaluate x > 5 and not y or x == 2 when x = 2 and y = False. Relational first: x > 5 is False and x == 2 is True. NOT next: not y is True. AND next: False and True is False. OR last: False or True is True, so the expression is True. Written with brackets: ((x > 5) and (not y)) or (x == 2).

Common questions

What does the WACE Year 11 Computer Science note "Programming" cover?

This note has 4 sections on Programming. It includes 14 key terms and formulas, plus 8 common mistakes. It covers U1, Unit 1 content area: Programming. The full section list is shown under “What this note covers”.

Is this WACE Year 11 Computer Science note free to read?

A sample section is free on the WACE Year 11 Computer Science hub. Full topic notes unlock with the Mastery Pack, one payment, no subscription.

Included in the WACE Year 11 Computer Science Mastery Pack

2 original practice exams with worked solutions, 4 revision notes, 40 practice questions and 48 flashcards.

Unlock Computer Science — $20

Preview a sample note and question free on the WACE Year 11 Computer Science hub →

WACE Year 11 Computer Science · revision note 1 of 4