Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Created May 2, 2017 23:11
Show Gist options
  • Save rogerwschmidt/97e91d34a6ec37f33597f08acd56b274 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/97e91d34a6ec37f33597f08acd56b274 to your computer and use it in GitHub Desktop.

Conditionals and Loops

Objectives

  • Explain how if statements work.
  • Chain an if statement using else if and end with an else statement.
  • Explain how while loops work.
  • Build a while loop.
  • Describe how to avoid building an infinite loop.
  • Explain how for loops work, and explain what the setup, condition, and increment are.
  • Be able to answer why someone would choose to build a while or for loop.

Lesson framework

Explain how if statements work.

CFU

Turn to your neighbor and how if statements worl

Chain an if statement using else if and end with an else statement.

CFU

Chain if statements for print a letter grade given a number between 0-100

90-100 "A"
80-89 "B"
70-79 "C"
60-69 "D"
0-59 "F"

Explain how while loops work.

CFU

Write down and explination of how while loops work

Build a while loop.

CFU

Build a while loop that counts from 1 to 10

Describe how to avoid building an infinite loop.

CFU

Turn to your neighbor and discuss what an infinite loop is and you avoid creating them.

Explain how for loops work, and explain what the setup, condition, and increment are.

CFU

Create a for loop that counts from 1 to 10. Talk to your neighbor about what each of the for loop are.

Be able to answer why someone would choose to build a while or for loop.

CFU

Turn and talk with your neighbor about why someone would choose to use a while or a for loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment