TactivergeLite

Lite / Building Machines That Respond / Week 5

Week 5: Conditional statements

Term 1: Computational Thinking

This week you will

Lessons

  1. Decisions from measurements: if, elif, else · about 35 min
    A battery charger must refuse to charge below 0 °C and above 45 °C. How does a program choose between three actions?
  2. and, or, not: safety interlocks in code · about 35 min
    A press may run only if the guard is shut, an operator is present and there is no fault. Can one line of Python say all that?
  3. Test the edges: boundary values · about 35 min
    Two versions of a charger rule pass every test at 20 °C. One damages the battery at exactly 45 °C. Which test would have caught it?
← Week 4Week 6 →