AAB - Flowchart Organization (Lesson)
Creating the Flow of Details
Flowchart Basics
Another method of describing details to organize your thoughts is using a flowchart. A flowchart shows the top-level flow of a program or the minute detail of an algorithm to solve a very specific problem. Visualization of what is to occur is provided with the flowchart. Symbols are used to represent various parts of a flowchart, the simplest being a rectangle indicating a process that will need to be accomplished. A more complex symbol, a diamond allows for choices or decisions based on choice. Sometimes this is a branch, where each choice takes its own path for a while and comes back together. Another choice may be to repeat parts of the flow, creating the repeat or loop, consolidating steps for efficiency. The repeated steps continue to be repeated until the choice changes based on the decision question.
In a team setup for writing a program, different portions of the team could write a section of code once the input and output of each section is known. The storyboard and flowchart allow a collaborative team to work together and split up the parts to accomplish the task in an effective manner. Using storyboard and flowchart techniques, members of a team can demonstrate their ideas for their section to the team, whereupon, all team members review, checking theirs for consistency to ensure correct flow when the parts are put together as the project progresses. A team member with a completed assigned part, may then be assigned another portion to complete as the completed part is added to the whole project.
Note that testing is going on individually and as the parts are being added together to ensure the integrity of the project. Testing is always with small portions added. As the project grows, the addition which was tested individually is now tested as part of the current state of the project build. Will issues be found? Yes, but the upfront design, collaboration, and repeated discussions of progress on the team, are meant to eliminate major issues as the project progresses.
Basic Flow Chart Shapes
Examine the flowcharts below. Look at the different shapes that are labeled with the type of information that is to be in the shape.
Flowchart Shape Definitions and Information
Oval Shape - Indicates where the flow of the chart will Start and End.
Parallelogram Shape - input to the flow.
Rectangle Shape - one or two processes that are to happen.
Diamond Shape - a decision statement, must be a choice, a decision.
Arrows - a few options; flow down the page.
to the side of a decision and then down again for neatness and easy readability
return and point to the entry arrow of another shape in order to repeat an instruction process
Labels - the Yes or No to a question. Alternate could be apple or orange if there was a choice.
Bar - allows the joining of 2 or more downward flows to one to enter any shape with a single entry.
Notes
- Arrows are not crossed, and planning is done to use a downward flow for easy reading during this course.
- A decision shape, the diamonds,
- allows for branching into choices that could result in repeating a section of code without rewriting.
- provides a key to what needs to be tested to ensure the decision works.
- Keep the flowchart as simple as possible, using single entry and exit points allows for quick ease of reading (exception multiple exits from the points are allowed.
- Programmers strive to not have infinite loops, so finding this on a diagram or knowing where the possibilities could occur from the flowchart diagram helps with debugging. If the yes answer is never a possibility, then an infinite loop occurs.
Flowchart symbol information. Use the arrows in the lower right-hand corner of the presentation to navigate.
Example of an Algorithm in Flowchart Form
Sum Algorithm - create a method to sum a given number of numbers from 1 to the user entered number.
Given the assignment above, below is the flowchart of this algorithm. Though this is a fairly simple algorithm, this is an algorithm that could be stored by the company for use with many programs that need a quick sum, standardizing the company work, and creating a library of methods that are ready to use when needed. Thus, a method, able to be used again in other programs without redevelopment.
Note:
- There are two pages for the flowchart below as the flow was too big for one page. Stopping the exiting page at a logical point, a circle connector shape was used to exit the first page and re-enter the second page.
- If there had been a need for two paths on the next page, a circle connector A would have been used for the first path and a circle connector B for the second path, allowing the passage of both paths onto the next page. The same letter in the connector is used for continued flow on the next page. Connectors from page to page are needed to ensure the flow is clear.
- Starting a variable, nbrIn, with a lower-case word followed directly by the next word beginning with a capital letter is called camelCase. The camelCase allows the eye to catch the new word easily. Names of storage items do not contain spaces.
In an upcoming assignment, you will create a flowchart. Use the flowchart shapes and the examples included here to create yours.
IMAGES GAVS CREATED OR IN PUBLIC DOMAIN AND USED ACCORDING TO TERMS OF USE.