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

Hour 7. Using Conditional Tests to Make Decisions

Hour 7. Using Conditional Tests to Make Decisions

WHAT YOU’LL LEARN IN THIS HOUR:

  • Using the if statement for basic conditional tests

  • Testing whether one value is greater than or less than another

  • Testing whether two values are equal or unequal

  • Using else statements as the opposite of if statements

  • Chaining several conditional tests together

  • Using the switch statement for complicated conditional tests

  • Creating complicated tests with the ternary operator

When you write a computer program, you provide the computer with a list of instructions called statements, and these instructions are followed to the letter. You can tell the computer to work out some unpleasant mathematical formulas, and it works them out. Tell it to display some information, and it dutifully responds.


  

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