End of Chapter

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  

Answer:

Neither option would be included, because the boolean expressions in the following

    if ( answer == 1 )
    if ( answer == 1 )

test that the user entered exactly "1". The user might have intended to include the options, but the program would not give any hint that there was a problem. A better program would write an error message when it got unexpected input.

End of Chapter

That is the end of this chapter. Students who wish to earn their stripes will carefully review the following.

Click on a term that interests you to go to where it was discussed.

In the next chapter you will see how to have the condition part of if statements ask more complicated questions.

You have reached the end of the chapter.

go to previous page   go to home page