5. Flow Control
Sometimes steps are changed or omitted
~ conditional statements
Sometimes instructions are common to several
recipes
~ function
6. Pseudo Code
Simply explain what you want to happen in
plain English
Recipe example
~ explain how to make pasta
7. Pseudo Code
Step 1: assemble ingredients
Step 2: boil water
Step 3: add pasta
Step 4: heat pasta sauce
Step 5: combine pasta and sauce
Step 6: serve
8. Apply to a Web Page
Let’s look at an example:
~ Google “weather Boston”
9. Apply to a Web Page
variables: weather and time
loop: eight times (8 weather/time pairs)
conditionals: change icon depending on
weather
conditions
functions: a more advanced topic for later
10. Pseudo Code
Step 1: assemble ingredients
time = 6:00 am
temperature = 50 degrees
Step 2: print ingredients
11. Pseudo Code
Step 3: change time and temperature
time = 9:00 am (increase time by 3 hours)
temperature = 52 degrees (increase
temperature by 2 degrees)
Step 4: repeat eight times
12. Assignment
Write pseudo code to display the bottom row
~ day of week (variables)
~ icons (conditionals)
~ high and low temperature (variables)
~ how many times? (loop)