Program description
|
Download
|
Solution to Exercise 3: Flowchart
(Sylvester and dog)
|
Program
Flowchart |
Program trace 1: program performs some
mathematical calculations that determines how big a cube grows.
|
|
Branching (if-else v1): program asks the
user for their age and reacts differently depending whether or not the user
is an adult. The program then executes an additional instruction and ends
|
|
While loop that continues converting the
user's human age to an equivalent cat age until the person quits the program
(the in-class exercise assumed that the 'say' function could display the
contents of all types of variables so there was no need to convert the
numeric age to a string equivalent).
|
|
|
|
Tutorial programs
|
Download
|
Handout tutorial 4-1: Branching exercise,
penguin on the ice (if-else)
|
|
Handout tutorial 4-2: Branching exercise,
Gum drop and a big fish (more complex if-else)
|
|
Handout tutorial 4-3: Simple looping,
clock
|
|
Extra looping example: Soccer program
|
|
Handout tutorial 4-4: Looping and the
do-together, rescue at sea
|
|