Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9: Comparing Data > Revisiting Boolean Logic

Revisiting Boolean Logic

In a previous chapter in this book, we introduced Boolean logic. Due to its prevalence in programming, we will revisit this subject in this chapter and go into more detail.

The most common comparison that you will program your application to perform is Boolean logic. Boolean logic usually comes in the form of if then statements. Boolean logic can have only one of two answers: yes or no. The following are some good examples of Boolean questions that you will use in your applications:

  • Is 5 larger than 3?
  • Does “now” have more than 5 letters?
  • Is 6/1/2010 later than today?

Notice that there are only 2 possible correct answers to these questions: yes and no. If you are asking a question that could have more than 2 answers, that question will need to be worded differently for programming.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint