In this lesson we take a look at control structures. Some control structures allow us to ask questions: if, if / else statements. Other control structures allow us to repeat code like for loops and while loops. Basically, control structures allow us to control the way the commands execute.
Students will be able to…
* Identify the different control structures we can use to modify the flow of control through a program
* Combine control structures to solve complicated problems
* Choose the proper control structure for a given problem
Control structures (like loops and if statements) are useful in building programs that can be applied in various Karel worlds. This lesson is designed to test students? knowledge of control structures in preparation for the upcoming Karel challenges.
Students will be able to…
* Analyze a solution to a problem and explain why it works
* Use control structures to create general solutions that work on all Karel worlds
Indentation is especially important when using multiple loops, functions, and if statements to show the structure of the code. The indentation gives you a good visual way to see what commands are inside vs. outside of a loop or if statement.
Students will be able to…
* Explain why it is important to indent code
* Identify proper indentation
* Modify a program to have proper indentation
* Write programs with proper indentation