A Flowchart 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:

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

This time, only the first true block was executed.

A Flowchart of the Program

This flowchart shows how the program works: Each true block of an if statement is like a "side-trip" that adds something to the totalCost. Both, neither, or just one side-trip might be taken.


hot wheels

QUESTION 12:

What would happen if the user answered both questions by typing "2" instead of "1" ?