Home Java Java-tips Flow If if-else Flowchart equivalent

Ask Questions?

View Latest Questions

Advertisement


 
 

if-else Flowchart equivalent
Posted on: July 26, 2006 at 12:00 AM
There are several graphical ways to show the flow of programs.

Java Notes

if-else Flowchart equivalent

Example of using if-else flowchart.

In if-else you can use elseif multiple times.

Learn how to use if-else flowchart.

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.

Copyleft 2005 Fred Swartz MIT License
Advertisement


DMCA.com