CHAPTER 40B — Truth Tables and De Morgan's Rules

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to home page   go to next page        

created: 06/04/06; small changes: 02/10/08

CHAPTER 40B — Truth Tables and De Morgan's Rules

Boolean expressions are used to control branches and loops in computer programs. Of course, branches and loops are fundamental to programming. This chapter shows some methods for working with boolean expressions.

Chapter Topics:

  • Truth Tables
  • De Morgan's Rules

Truth tables are used to analyze boolean expressions. De Morgan's rules can transform confusing boolean expressions into easier ones. Both of these techniques are used in programming and in computer hardware design (and in other areas). Questions about boolean expressions and De Morgan's Rules are prominent on the AP Computer Science Test.

QUESTION 1:

(Review :) What is the value of:   x<12 && y>10

Assume that x contains 9 and y contains 7.