Lesson Objectives
This lesson introduces the three core structures that can be found in programming languages: sequence, decision/conditional (if), and iteration (loops) constructs. An important concept in conditional and iteration statements is that of a Boolean expression. The lesson will introduce comparison (relational) and Boolean (logical) operators that can be composed to express statements that are evaluated to true or false. The ability to express Boolean expressions is core to the test conditions of decision and iteration statements. Programs also need to store values as they perform a computation. The ability to declare variables, and the notion of data types, are also discussed in this lesson. You are encouraged to type in all of the examples in the slides/presentations/videos yourself in Snap! and try to get them to work. Overall, this lesson will take much more time to complete than past lessons if you decide to follow along and try out all of the programs on your own. Those who have taught computer science before will likely find these lessons as fundamental, but the context of presentation within Snap! may be offer new ideas.
Class Exercise - Decision Structure - grade converter from video
Compose the solution using if/then and boolean expressions
No comments:
Post a Comment