1. Decision Making

lightning

This chapter looks at how computer programs make decisions using the if statement. This statement is one of the fundamental building blocks of programming.

Chapter Topics:

      • Two-way Decisions
      • The if statement
      • Outline of a two-way decision
      • Blocks of statements
      • Boolean Expressions
      • Relational Operators
      • Example Programs


Question 1:

You are driving in your car and it starts to rain. The rain falls on your windshield and makes
it hard to see. Should your windshield wipers be on or off?


Source: Bradley Kjell, http://programmedlessons.org/Java9/chap16/ch16_01.html
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 License.