Your SlideShare is downloading. ×
General Assembly
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

General Assembly

185
views

Published on

Published in: Technology, Business

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
185
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Control Flow Option 2
  • 2. Where We Are We have developed an understanding of the following technologies: HTML CSS The final front-end development technology: JavaScript
  • 3. Flow Control JavaScript is programming Programming is simply a series of instructions ~ think recipe
  • 4. Flow Control Sometimes the ingredients change ~ variables Sometimes steps are repeated ~ loop
  • 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)