How to Turn a Java Source Code Into a Flow Chart
A flow chart is a chart using symbols to show the flow of a program. There is a symbol for every action, or step, taken in the program. Converting Java source code into a flow chart can let programmers go through their program step by step to see exactly how it is going to work on the computer. This lets programmers identify any logical errors in the program and correct them in the code. Programmers can create flow charts and correct errors before the source code is created also.
Instructions
-
-
1
Draw an oval in the middle of your paper at the very top and write "Start" inside of it. This symbol identifies the beginning of the program using Java source code.
-
2
Draw an arrow underneath the oval, making sure it is pointing down. The arrow signifies that the program is moving on to the next step.
-
-
3
Go to the first action taken in your Java source code and identify the corresponding symbol for the action. For example, if you declare variables, the symbol would be a rectangle. If you are accepting input from the user, the symbol would be a parallelogram.
-
4
Plot your symbol on your paper by drawing it underneath the arrow that is pointing down. You can write a brief description of what is being done inside the symbol for more clarity. For example, a rectangle used to declare variables can have "int n" written inside of it.
-
5
Continue to plot a symbol and an arrow for every action taken in your program until you come to the end.
-
6
Draw an oval under the last arrow you drew pointing down, which should be located underneath the last action symbol in your flow chart. Inside the oval write "End" to signify that this is the end of the program. There is no need to draw another arrow because your flow chart is complete.
-
1
Tips & Warnings
You can find a list of flow chart symbols online (see Resources).
References
Resources
- Photo Credit business flow chart orange image by Nicemonkey from Fotolia.com