# EZ Math Movie, Tutorials, Decisions, True or False

### What is true or false?

True and false are values. Values are the results of expressions. True and false are the results of Boolean expressions. (Boolean expressions are named after a mathematician named Boole who formalized the mathematics of true and false.)

Now, an arithmetic expression may have a result value of -3, 0, 2.85, and so on. For example, 5 - 8 = -3. These are numeric values. A Boolean expression can have a result value of only true or false. A Boolean expression equals true or it equals false. These are Boolean values.

Boolean expressions come in many types. For our tutorial purposes here, we will say that Boolean expressions are used when you want to compare two numeric values. They answer questions like: 'Is the first value greater than the second value?' or: 'Are these two values equal?' When a Boolean expression answers questions such as these, it is said to evaluate to true or false. One might say that the Boolean expression returns true or false, or that the Boolean expression becomes true or false.

### Writing Boolean expressions

In order to write Boolean expressions you first need to know the programing symbols for math statements like: 'is equal to' or: 'is greater than'. These symbols are:

### The parentheses

The parentheses around the Boolean expressions, such as (2 == 2), in the table above are optional. They do make the expressions easy to read, though, and we will usually adopt this style at EZ Math Movie.

### True and false values

People's names have values like 'Tom' and 'Sue'. Numbers have values like 1, 2, and 3. Boolean expressions can have only two values: true or false. So, if someone made this programing statement:

`a = (2 == 2);`

Then the variable a would hold the value true since the boolean statement (2 == 2) is true. And if we followed this up with:

`print(a);`

Then we would actually see the word 'true' on the printer.

### Running the example program

Boolean expressions may look a bit unusual when first encountered, especially when a variable is set equal to one. A variable in EZ Math Movie can hold a numeric value or a Boolean value. (There are other types of values they can hold, too, but that does not concern us currently.)

Note that when you print a variable that holds a Boolean value, then the words 'true' or 'false' will appear on the printer.

For learning purposes, the example program prints the results of Boolean expressions without showing how they are to be used practically. Boolean expressions, as we will see, are most often used to control decisions and loops.

### The example program

0ptions

Go on input

Bounds:
Sorry, apparently this browser does not support HTML 5 canvas tag graphics.
Printer

Edit: Runtime          View: Starter Suggestion

To runtime:

Storage:

Editor width: Normal Wide

### And....

Next tutorial: The if statement

Here is a link to a related article at EZ Programing Demos:

### Other sites you may find interesting

Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Custom Search

Name:
Domain:

Name
0

Name:
Name
0