The Minimum You Need to Know About Logic to Work in IT by Roland Hughes - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

1.3 Top Checking Loop

img6.png

Let me speak about convention here. Forward flow always runs down the page. Return branches are always drawn on the left. Forward branches either go down or to the right. Most instructors would not let me have the end terminal stuck out to the right like that. They would make me place it at the bottom of the page and connect my arrow to it. Some people are quite picky about the placement of this terminal. I’d rather be picky about how much logic you learn.

Some of you may be wondering how I created these flowchart images because they are much smaller and somewhat different from the images I presented initially. The first images came directly from WordPerfect. To save space and speed things up I purchased a copy of “Flow Diagrams Software” http://www.anydraw.com. I didn’t do a large quantity of analysis. There are a lot of shareware products out there which draw flowcharts. This product cost me around US $30.00 and let me save flowcharts as JPEG files to import into WordPerfect. Your instructors may make you draw things by hand with a plastic template. No great crime there, I did it for two years. Back then I think I spent $30.00 and got a good 0.05mm pencil. They had just come out and weren’t common enough to be cheap. (I told you, I’m old!)

There is a variation of the this loop that does not use a counter variable, it uses a “flag” variable. Many professors and books will call this a boolean variable. From the logic perspective, it doesn’t matter what you call it, and the data type may be preordained by your choice of implementation languages. To use this variation you initialize a variable to a known value (TRUE, FALSE, 0, 1, etc.). The test in the decision symbol checks for an equality or inequality. You typically set the flag to another value based on some condition which may be triggered from outside resources. Sometimes it becomes what is really a middle checking loop.