Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Control Flow
Option 2
Where We Are
We have developed an understanding of the
following technologies:
HTML
CSS
The final front-end development te...
Flow Control
JavaScript is programming
Programming is simply a series of instructions
~ think recipe
Flow Control
Sometimes the ingredients change
~ variables
Sometimes steps are repeated
~ loop
Flow Control
Sometimes steps are changed or omitted
~ conditional statements
Sometimes instructions are common to several
...
Pseudo Code
Simply explain what you want to happen in
plain English
Recipe example
~ explain how to make pasta
Pseudo Code
Step 1: assemble ingredients
Step 2: boil water
Step 3: add pasta
Step 4: heat pasta sauce
Step 5: combine pas...
Apply to a Web Page
Let’s look at an example:
~ Google “weather Boston”
Apply to a Web Page
variables: weather and time
loop: eight times (8 weather/time pairs)
conditionals: change icon dependi...
Pseudo Code
Step 1: assemble ingredients
time = 6:00 am
temperature = 50 degrees
Step 2: print ingredients
Pseudo Code
Step 3: change time and temperature
time = 9:00 am (increase time by 3 hours)
temperature = 52 degrees (increa...
Assignment
Write pseudo code to display the bottom row
~ day of week (variables)
~ icons (conditionals)
~ high and low tem...
Upcoming SlideShare
Loading in …5
×

General Assembly

336 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

General Assembly

  1. 1. Control Flow Option 2
  2. 2. Where We Are We have developed an understanding of the following technologies: HTML CSS The final front-end development technology: JavaScript
  3. 3. Flow Control JavaScript is programming Programming is simply a series of instructions ~ think recipe
  4. 4. Flow Control Sometimes the ingredients change ~ variables Sometimes steps are repeated ~ loop
  5. 5. Flow Control Sometimes steps are changed or omitted ~ conditional statements Sometimes instructions are common to several recipes ~ function
  6. 6. Pseudo Code Simply explain what you want to happen in plain English Recipe example ~ explain how to make pasta
  7. 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. 8. Apply to a Web Page Let’s look at an example: ~ Google “weather Boston”
  9. 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. 10. Pseudo Code Step 1: assemble ingredients time = 6:00 am temperature = 50 degrees Step 2: print ingredients
  11. 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. 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)

×