Please enable JavaScript to use CodeHS

AP Computer Science Principles in Roblox

Lesson 2.1 Booleans and Conditionals

Description

In this lesson, students learn about if and if/else statements as a way to make decisions and execute specific code depending on the validity of a condition. They will also learn about and use Boolean values. Booleans refer to a value that is either true or false and are used to test whether a specific condition is true or false.


Objective

Students will be able to:

  • Create Boolean variables to represent meaningful yes/no values
  • Print out the value of a Boolean variable
  • Explain the purpose of if and if/else statements
  • Create their own if/else statements to selectively choose which code is executed in their programs