Boolean Variables
A group of problems that help you to practice declaring, assigning, and using variables with a type of boolean.Intro to Boolean Variables
Boolean variables follow the same basic format type variableName = value
. For boolean variables this means their type is boolean and their value is either true or false.
Read through the blocks in the tray. Then use only the blocks in the tray to build a program that declares two boolean variables and displays the values of each.
This program should show the following:
false
true
Practice Boolean Variables
Using the skills you learned in the last problem, build the same program using standard blocks in the tray.
This program should make the same output:
false
true
Boolean Logic: and
In this problem, you are given four boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved all four logic problems, run your program and check your answer.
Boolean Logic: or
In this problem, you are given four boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved all four logic problems, run your program and check your answer.
Boolean Logic: not=
In this problem, you are given four boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved all four logic problems, run your program and check your answer.
Boolean Logic: =
In this problem, you are given four boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved all four logic problems, run your program and check your answer.
Boolean Logic: not
In this problem, you are given two boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved both logic problems, run your program and check your answer.
Boolean Logic
In this problem, you are given four challenging boolean logic blocks to solve. Read through each block in the program and decide whether the result for each is true or false. Then drop the true or false output block below the logic problem to show your solution to that problem. Once you have solved all four logic problems, run your program and check your answer.