Single-block if Statements

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 previous page   go to home page   hear noise   go to next page

Answer:

Pig out on chocolate-chip cookies!

Single-block if Statements

cookies

The decision is about whether to buy cookies or just stroll on by. In the flow chart, start at the top, then follow the line to the question:

are you hungry?

The answer to the question is either true or false.

If the answer is true,
      follow the line labeled true,
      perform the action in the box "buy cookies",
      then follow the line to "done".

If the answer is false
      follow the line labeled false to "done".

QUESTION 2:

How is this chart different from the charts in the previous chapter?