previous | start | next

## Boolean Operations

- An operator that combines test conditions is called a logical operator.
- The `&&` (and) operator combines several tests into a new test that passes only when all the conditions are true.

  >     if (now.get_hours() == homework.get_hours()
  >           && now.get_minutes() == homework.get_minutes())
  >        cout << "The homework is due right now!\n";

- The `||` (or) operator combines two or more conditions and succeeds if at least one of the conditions is true.

  >     if (state == "HI" || state == "AK")
  >        shipping_charge = 10.00;

previous | start | next