# Java Notes

# if-else Flowchart equivalent

There are several graphical ways to show the flow of programs. Here is a program fragment and the equivalent flowchart.

        . . .
        score = Integer.parseInt(scoreStr);
        if (score > 70) {
            message = "pass";
        } else {
            message = "fail";
        }
        JOptionPane.showMessageDialog(null, message);
        . . .

## Flowchart equivalent

Arrows show the the flow of execution. Boxes contain one or more Java statements that are executed in sequence. Diamonds stand for decisions ("if" statements), and the two arrows coming out of a diamond are labeled with the conditions that must be true to take that path.