> For the complete documentation index, see [llms.txt](https://www.csprinciples.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csprinciples.com/big-idea-3/3.5-boolean-expression.md).

# 3.5 Boolean Expression

## Enduring Understanding

The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

## Learning Objective

For relationships between two variables, expressions, or values:

a. Write expressions using relational operators.&#x20;

b. Evaluate expressions that use relational operators.

## Essential Knowledge

A Boolean value is either true or false.

The exam reference sheet provides the following relational operators: =, ≠, >, <, ≥, and ≤.

Text and Block:

* a = b
* a ≠ b
* a > b
* a < b
* a ≥ b
* a ≤ b

These are used to test the relationship between two variables, expressions, or values. A comparison using a relational operator evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise, it evaluates to false.

## Learning Objective

For relationships between Boolean values:

a. Write expressions using logical operators.

b. Evaluate expressions that use logical operators.

## Essential Knowledge

The exam reference sheet provides the logical operators NOT, AND, and OR, which evaluate to a Boolean value.

The exam reference sheet provides

Text:

NOT condition

Block:

<figure><img src="/files/V3oy3wU5p3fVsduUDNqn" alt=""><figcaption></figcaption></figure>

which evaluates to true if condition is false; otherwise it evaluates to false.

The exam reference sheet provides

Text:

condition1 AND condition2

Block:&#x20;

<figure><img src="/files/sRtmGICbiaNNACRHnXtF" alt=""><figcaption></figcaption></figure>

which evaluates to true if both condition1 and condition2 are true; otherwise it evaluates to false.

The exam reference sheet provides

Text:

condition1 OR condition2

Block:

<figure><img src="/files/0Vdg05uopcVndcPB7nOO" alt=""><figcaption></figcaption></figure>

which evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise it evaluates to false.

The operand for a logical operator is either a Boolean expression or a single Boolean value.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.csprinciples.com/big-idea-3/3.5-boolean-expression.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
