Section 7.6

Conditionals

Learning Goals


AAP-2.H.1: Conditional statements, or “if-statements,” affect the sequential flow of control by executing different statements based on the value of a Boolean expression. 


CRD-2.J.1: In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs. 


Objectives and Description

The objective of this lesson is to introduce students to boolean expressions, conditionals, and relational operators. All of these concepts work in tandem to allow programs to make decisions based on varied input values. Students will be using conditionals to take user input and control the outcome of a script that is being run, which in this case will result in a song tailor-made to user choices.

Activities

Activity 7.6.1 (Budget 55 minutes)