Flowcharts
Are you having trouble visualizing how your program works? Flowcharts are a great way to visualize the flow of your program and how the different parts of your program interact with each other. They are a great tool for planning out your program before you start coding. Although, if you don’t want to make one, that’s fine too as I don’t always make flowcharts for my programs.
Common Flowchart Symbols
Flowcharts use different symbols to represent different parts of your program. Here are some common flowchart symbols that you will encounter when creating flowcharts:
| Symbol | Name | Function |
|---|---|---|
| Terminal | Used to denote the beginning and ending of a flowchart. | |
| Flowlines | Used to show the next step in the flowchart. | |
| Preparation | Used for declaring and initializing variables and/or constants. | |
| Input/Output | Used for entering data and for displaying the results. | |
| Process | Represents a process or action that is performed in your program. | |
| Decision-Making | Used for branching. Shows which alternative will be followed by the flowchart. | |
| Connector | Used to connect a part of a flowchart to another without the need of very long flowlines. | |
| Subroutine | Represents a function or a subroutine in your program. |
Flowchart Examples
- Flowchart for a simple program that prints “Hello World”:
Sample Output:
HeLLo WoRld- Flowchart that will show a name and age:
END
Sample Output:
Name: John DoeAge: 20- Flowchat where the user will input their age and display “You’re too young to drink” if the age is 17 or less, or print “You can drink” if the age is 18 or more:
Sample Output:
Enter your age: 17You're too young to drink- Flowchart that has a function that will return the sum of two numbers:
Sample Output:
Enter the first number: 5Enter the second number: 10The sum is 15