Flowchart

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:

You could first divide the group into:

  • children
  • adults

And then divide the adults into:

  • male adults
  • female adults

Flowchart

We wish to perform two splits to divide integers into negative, zero, and positive. First zero and positives are split from the negatives, and then that group is further split.

[three way decision]

The flowchart shows how this works. One decision is nested inside the false branch of the first decision. A negative integer is correctly sorted out by the first decision. But a zero or positive integer goes through another decision to pick the correct category for it.

QUESTION 17:

Are there other ways to do this?