Skip to content
ExamSpine

Computer Science · the course

Programming, step by step

One idea at a time. Read it, then practise it.

67 of 126 lessons are ready. The theory side of the course is not written yet.

Java answers can't run on Spine yet. You can still read Java, trace it, and put an answer's lines in order.

Part 1

Programs that talk

  1. 1.1Print one line2 exercises
  2. 1.2Statements run top to bottom2 exercises
  3. 1.3Read a line and print it back2 exercises
  4. 1.4Join text with +2 exercises
  5. 1.5A variable holds one value; assigning again replaces it3 exercises in Python1 exercise in Java
  6. 1.6Read several lines, use them in any order2 exercises
  7. 1.7Four basic types1 exercise
  8. 1.8Turn typed text into a number4 exercises
  9. 1.9Operators and precedence3 exercises in Python2 exercises in Java
  10. 1.10Whole-number division and remainder3 exercises in Python2 exercises in Java
  11. 1.11Keeping the fraction; when conversion loses information2 exercises
  12. 1.12Capstone: several inputs, several results1 exercise

Part 2

Decisions

  1. 2.1if3 exercises in Python2 exercises in Java
  2. 2.2Comparison operators2 exercises
  3. 2.3else3 exercises in Python2 exercises in Java
  4. 2.4else-if chains; the first true branch wins3 exercises in Python2 exercises in Java
  5. 2.5Remainder inside a condition2 exercises
  6. 2.6Comparing text2 exercises
  7. 2.7and, or, not3 exercises in Python2 exercises in Java
  8. 2.8Nested conditions1 exercise
  9. 2.9Trace a branching program2 exercises in PythonReading only in Java
  10. 2.10Capstone: several rules decide one answer1 exercise

Part 3

Repetition

  1. 3.1Loop until a stop value3 exercises in Python2 exercises in Java
  2. 3.2Every loop needs an update; find the infinite loop2 exercises
  3. 3.3The counting pattern2 exercises
  4. 3.4Sum and average, with an empty-input guard3 exercises in Python2 exercises in Java
  5. 3.5Count-controlled loop3 exercises
  6. 3.6Loop bounds from input; a running total over a range2 exercises
  7. 3.7Nested loops3 exercises in Python2 exercises in Java
  8. 3.8Trace a loop: iterations and final values2 exercises in Python1 exercise in Java
  9. 3.9Read and trace a loop flowchartoptional · 2 exercises
  10. 3.10Capstone: read a stream, report several statistics1 exercise

Part 4

Functions

  1. 4.1Define and call a function2 exercises
  2. 4.2Pass a value in2 exercises
  3. 4.3Return a value3 exercises
  4. 4.4Parameter versus argument; returning versus printing3 exercises
  5. 4.5Several parameters; order matters2 exercises
  6. 4.6Functions that call your functions3 exercises
  7. 4.7Local and global scope3 exercises
  8. 4.8Capstone: split a long program into functions1 exercise

Part 5

Text, lists, stacks and queues

  1. 5.1Length and one character by position3 exercises
  2. 5.2Substring by position3 exercises
  3. 5.3Search, replace, change case4 exercises
  4. 5.4Loop over the characters3 exercises in Python4 exercises in Java
  5. 5.5Create a list; index; length4 exercises
  6. 5.6Update, add, remove4 exercises
  7. 5.7Loop over a list two ways4 exercises in Python3 exercises in Java
  8. 5.8Accumulate over a list3 exercises
  9. 5.9Search a list; find the largest without built-ins3 exercises
  10. 5.10Split a line into parts; join parts3 exercises
  11. 5.11Trace list code and state the final contents2 exercises in Python1 exercise in Java
  12. 5.12Fixed-size arrays versus growable lists2 exercises
  13. 5.13Two-dimensional lists: rows and columns3 exercises
  14. 5.14Stack: push, pop, last in first out4 exercises
  15. 5.15A problem a stack solves2 exercises
  16. 5.16Queue: enqueue, dequeue, first in first out2 exercises
  17. 5.17A problem a queue solves2 exercises
  18. 1 lesson not written yet
  19. 5.19Capstone: read record lines, split, report1 exercise

Part 6

Errors, testing and files

  1. 6.1Syntax, run-time and logic errors2 exercises
  2. 6.2Find a bug by tracing and printing2 exercises
  3. 6.3What an exception is1 exercise
  4. 6.4Catch and recover2 exercises
  5. 6.5Validate before use4 exercises
  6. 6.6Design test cases: normal, boundary, invalid2 exercises
  7. 8 lessons not written yet

Part 7

Algorithms

  1. 7.1Efficiency is measured against input size2 exercises
  2. 7.2Common complexity classes2 exercises
  3. 7.3Big O from loop structure3 exercises
  4. 10 lessons not written yet

Parts 8 to 10 are not written yet (40 lessons): One class, Several classes (HL only), Abstract data types (HL only).