A Run of the Program

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:

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

(There are other ways to correctly complete the program.)

A Run of the Program

This program uses two if statements. Say that the user does not want pin stripes but does want anti-lock brakes:

Do you want pin stripes (0 or 1)? 0
Do you want anti-lock brakes (0 or 1)? 1
Total cost is: $20800.0

QUESTION 11:

Show the dialog for a user that wants pin stripes but does not want anti-lock brakes.