• Unit 5: Control Structures

    Control structures dictate what the behavior of a program will be under what circumstances. Control structures belong to one of two families: those that test values and determine what code will be executed based on those values, and those that loop, performing identical operations multiple times. Control structures like if-then-else and switch the program to behave differently based on the data that they are fed. The while and for loops allow you to repeat a block of code as often as it is needed. As you can see, that functionality can be very useful when designing complex programs. This unit will introduce you to control structures and the ways in which they are used before moving on to discuss if, switch, while/do-while, and for loops. We will also discuss some advanced topics, such as nesting and scope. By the end of this unit, you should be able to draw from the information you learned in the previous unit to create a control structure, which will allow you to create more complex and useful programs.

    Completing this unit should take you approximately 20 hours.