Title:
URL:
Content Source:
Overview:
This lesson introduces students to while loops and if / else statements. While loops are loops that continue to repeat commands as long as a condition is true. While loops are used when the programmer doesn't know the exact number of times the commands need to be repeated, but the programmer does know what condition needs to be true in order for the loop to continue looping. If / Else statements offer flexibility in programming by running entire sections of code only if something is true, otherwise, it runs something else.
while
if / else
If / Else
A basic understanding of conditionals is a recommended prerequisite for Course E. We created this introduction to give a review for the students already familiar to conditionals and allow practice for the students that are just learning. If you find that the understanding of conditionals varies widely in your classroom, we recommend a strategic pairing of students when completing this online lesson.
Students will be able to:- define circumstances when certain parts of a program should run and when they shouldn't.- determine whether a conditional is met based on criteria.
Note: You will need to create a free account on code.org before you can view this resource.