THE AUTOMATED FLOWCHART DESIGN AND CODE WRITING SYSTEM |
Home || Contact us || Create code logic || |
LogicCoder Online Tutorial 5 of 7-CREATE FLOWCHART |
Learn how to use LogicCoder to draw Flowcharts and write ProgramsThis section of the tutorial introduces the basic operation of drawing a program flowchart with LogicCoder. You can use LogicCoder to quickly draw flowcharts by clicking symbols into position. You can also use LogicCoder layout editing features to align symbols relative to each other and to clip connecting line symbols to enhance the layout looks of your flowcharts.Apart from easy program flowchart design, LogicCoder allows you to generate code using the control logic in your flowchart. This tutorial shows you how to draw the flowchart design for a relative simple program problem and then use the flowchart to generate a source program in BASIC and in ANSI C++. Use this link to convert your source code to LogicCoder and Ms Excel flowchart. |
|
|
At the end of going through these tutorials you should |
|
|
You get a free tutorial version of LogicCoder for ANSI C/C++ and BASIC programming whenever you make on-line purchase of any of the following books.
In this example program problem I show you how to Design, Document a problem solution and how to map language command statements to algorithmic descriptive statements using a flowchart. I then show you how to generate the C source code from the logic design. Click the following link to download the tutorial in pdf format. Click to download Please note however, that some section of this tutorial is missing. In addition, you must observe all copyright regulation in using the tutorial document. To begin, I start with a program problem specification as follows. A program is to be designed and then coded in ANSI C/C++ that creates an output listing of telephone information on individuals. Input to the program consists of records of data values. A sample of these records to be used as test data is listed in the table below. |
|
INPUT TEST DATA VALUES
|
||
| Name | Telephone Number | Area Code |
|
SAM HORN |
749-2138
663-1271 999-1193 979-4418 999-9999 |
714
213 212 312 999 |
|
The input data file is to be listed as part of the program code for the purpose of testing the program. In this case, an array of record structure is declared in the program and the value in each record is used to initialize the elements of the array. The structure of each record is defined with the use of the C struct statement as illustrated here. LogicCoder has functions that allows you to insert code sections into
a source code file to be generated from a flowchart. You select the point
in the program logic where you want the code to be inserted and you specify
the code value you want inserted. You can also define variables and structures
to be inserted in a source code to be generated. |
||
|
OUTPUT FROM THE PROGRAM
|
||
![]() |
||
| The following is an illustration of the control logic which
when coded implement the solution to the program problem. Actually, the
solution is derived from an original solution designed for implementation
in BASIC. LogicCoder has functions available that allows you to use this
control logic to generate a source program in BASIC without having to do
much changes to the flowchart layout. |
|||
|
The program control logic design |
|||
|
The logic to be used to implement the programming problem solution is illustrated by the flowchart in figure 1. Notice that a loop is appropriately used to process the array of records that constitute the input data file. The flowchart is an algorithmic description of the step-by-step process that is to be accomplished in order to implement the solution to the program problem. Note that 2 Input/output symbols are drawn at the start of the program flowchart. They are used to print the first two lines on the output report. Each line is followed by a blink. Each is easily done in ANSI C/C++ with use of the printf( ) function. In fact, both lines could be easily printed by a single printf( ) function by use of an appropriate formatting string. |
![]() |
||
Figure 1 The control logic to be used by the source program that implement the given specification. A loop base on a counter variable is used to process the records in the input data file. |
|||
|
I now show you how to use LogicCoder to do the following: USING LOGICCODER TO DRAW THE PROGRAM FLOWCHART |
|||
|
STEP 1:
|
.
![]() |
||
On start up, LogicCoder sets a default fill colour when drawing flowchart symbols. You can change the default fill colour to a value of your choice or you can select individual symbols in an existing flowchart and then set their fill colour to that of your choice. I show you how this is done at a later point in the tutorial. |
|||
|
STEP 2:
|
![]() |
|
Whenever you click in the user document window with a selected flowchart symbol from the flowchart template toolbar, either of the following 2 things happens. (1) A copy of the selected flowchart symbol appears in the user document window at the point where you click. (2) If a flowchart symbol is already at the point where you click, it is selected in the user document. |
||
|
STEP 3:
|
![]() |
|
I now show you how to insert and then fragment a compound symbol when drawing a flowchart. The last two symbols on the flowchart template bar are example compound symbols that you can use to quickly draw loops and case structures when implementing decision making control logic. More advance versions of LogicCoder uses other compound symbols to represent other complex substructures such as start and end terminal symbols or a closing connector. |
||
|
STEP 4: Notice that a selected symbol appears with a yellow rectangle around it. In the next step, you will use the Fragment Structure function to break the compound symbol into it's constituent.
|
![]() |
||
|
In the next step you will complete the flowchart so that it implement the control logic illustrated in figure 1. You will then add descriptive and source code text to each symbol in the flowchart. The description is that illustrated in figure 1. The descriptive text is the same as the Algorithmic text. When you start or open a flowchart document, LogicCoder by default sets the text view to Algorithmic. The Algorithmic text view of a flowchart allows you to see description of each instruction in the algorithm illustrated by the flowchart. In the section of this tutorial headed: SAVING THE SOURCE CODE TEXT FILE, I show you how to switch the text view of a flowchart. The "Source Code" view of a flowchart presents actual program command statement(s) in each symbol of the flowchart. These are source language commands that are to be executed in the required program. Each program command statement matches a description in a symbol. |
|||
|
In the next step, you will complete the flowchart so that it looks similar to that in figure 1 |
![]() |
|
|
|
||
|
STEP 6:
|
![]() |
||
|
STEP 7: At this point, your document window should appear
similar to that in figure 9 |
||
|
(1) Use the mouse left button to click the Autoadjust All Line menu item so that the function execute. At the end of executing this function, your flowchart should look similar to that illustrated in figure 10.
|
![]() |
|
You can also execute the Autoadjust All Lines functions in a flowchart by clicking on the shortcut button on the Flowchart Edit shortcut toolbar. To do this, you click the button labeled Aa. |
||
|
More advance versions of LogicCoder also provides other autoadjust functions that allow you to align groups of symbols vertical or horizontal along common axes. There are also functions that allow you to align connectors with case decisions in a complex flowchart.
|
![]() |
||
CONGRATULATION!! You have completed the flowchart layout for the program problem logic solution and is now ready to enterdescriptive and language command text into the flowchart symbols.
Copy right © May 2002
Logic Code Generator Ltd
73a Oldfield Road
London NW10 9UT
Tel: +44(0)208 451 5097
EMail: info@logiccoder.com
| Home | Purchase LogicCoder | Programming Books | User Interface | Example Flowcharts |