Lesson 9Understanding Flowcharts and Algorithms
Flowcharts allow us to visualize how the application will flow from one instruction to the next, from start to finish. Building a flowchart before we start to code a program helps ensure that we don't skip any steps in the program itself, as well as giving us a tool to easily communicate those steps to others.
FLOWCHART BASICS
One of the interesting things about programming is how surprisingly simplistic computers and programs really are. Even though we can create massive-scale programs that perform complex tasks, there are really only three things a program can do.
- Sequence: Execute a series of statements in order
- Branch: Follow a specific path based on a defined condition
- Loop: Repeat a series of instructions until a condition is met
We use the term flow of control to define the path that a program takes from one instruction to the next, and we use a flowchart to visualize the flow of control.
Another important term is algorithm. While TV shows and movies make algorithms sound like very technical things that only a software developer could understand, the term algorithm is really just a well-defined set of instructions that a computer or similar machine can follow to ...
Get Job Ready Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.