THE AUTOMATED FLOWCHART DESIGN AND CODE WRITING SYSTEM |
Home || Contact us || Create code logic || |
LogicCoder Online Tutorial 6 of 7-GENERATE PROGRAM LOGIC CODE |
Learn how to edit flowchart text and layoutThis 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.
If you are doing this tutorial online, then you should have gone through the previous tutorial document before starting this section. IF YOU HAVE NOT DONE THE PREVIOUS SECTION. Click the following link to download the tutorial in pdf format Download. You must observe all copyright in using the tutorial document. Here is a quick review of the program problem specification to begin with. A program is to be designed and then coded in ANSI C/C++ that creates an output listing of telephone information on individuals. A sample of input data to be used for testing the program and the resulting output from the program is given as follows. |
| 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 |
| OUTPUT FROM THE PROGRAM |
![]() |
ADDING TEXT TO EACH SYMBOL |
||
|
STEP 1:
|
![]() |
|
|
You can also set the Select button to select a group of symbols by liaising with the mouse left button. In this case, you press and drag the mouse left button so that the set of symbols you want to select appears within the outlined rectangle that appear as you drag with the mouse left button. Figure 24 illustrates how this is done. At this point, I will leave some of the illustration figures out as I do not want to have too much of a long web page. In addition as I proceed, I will also leave out additional information to restrict the size of this web page. However, you can have a full copy of the complete tutorial in pdf format by clicking the following link. Download STEP 4: At this point, you should have a document window similar to that illustrated in figure 13. The Write Symbol Text function allow you to place text in symbols by either writing the text value through the two text editing boxes or you can select an appropriate text value from a list associated with the selected symbol. Notice that the dialog window presented by this function also display the kind of selected symbol whenever it executes. This function allows you to place either a "Yes" or a "No" value in certain line symbols. The selected line symbol must be connected to a non Switch-Case decision symbol. In this case, if you select either of the two connected lines and then place a text value, the function will search for the other connected line symbol and then place the complementary text value in it. LogicCoder also allow you to place text in other kinds of line symbols that form part of the entry in a select case structure. However, this tutorial version of LogicCoder does not allow you to implement flowcharts with the select case structure. STEP 5: |
||
|
At this point, LogicCoder places the text value "START" in the "Algorithmic" and the "Source Code" text views of the selected symbol. Refer to figure 1 for a quick summary review of the description of the program algorithm to be implemented by our flowchart. In the next few steps, you will place ANSI C/C++ source code command statements and descriptive text values in the sequence of symbols that follows.
|
![]() |
||
|
STEP 6: Recall that whenever we read the control logic given in a flowchart, we read from top to bottom and from left to right. Therefore, we do not use arrowhead flow-lines and we do not have left handed loops. This convention helps to simplify the analysis and evaluation of the control logic in a flowchart. STEP 7: At this point, your document window should look similar to that illustrated in figure 14 STEP 8: |
|||
|
The Algorithmic text editor allow you to enter text that describe the event or process that is to take place at that point in the program sequence represented by the flowchart symbol.
|
![]() |
||
|
STEP 9: (2) Click the OK button in the Write Symbol text dialog window when you are finish. LogicCoder place the text you entered into the flowchart symbol. The descriptive text is display in the flowchart symbol as illustrated in figure 15. The command statement is the actual instruction in a source language that tells the computer to do the thing that you describe with the Algorithmic text. You do not need to terminate a command statement with a statement terminator such as ";" in the case of C/C++ or similar languages. STEP 13: |
|||
|
Click the "No" button in the Write Symbol Text dialog window that appear and then press the Enter key or click the OK button. Your document window should look similar to that in figure 17 before you click the OK button or press then Enter key.
|
![]() |
|
|
LogicCoder does not allow you to place such text in a line symbol that follows a Switch-Case Decision symbol. This is because the control logic implemented by a Switch-Case Decision is different from that implemented by a loop or a case decision. |
||
SAVING THE FLOWCHART |
||
|
STEP 1: STEP 2: (2) Save the file with the following name: Tutor00.flw. Make note of the location where this file is saved. You will look for the generated source code in this same location. When you execute the Save function, LogicCoder saves both the flowchart and its text content together. However, you can also save the source code text separate from the flowchart and you can also load specific sequence of source code text into a flowchart. If you save the source code text of a flowchart with the intention to reuse it at a future date, then you should pay careful attention to any changes that you do to the outlay of the control logic in the flowchart. Edit operations on a flowchart such as a symbol deletion affects the sequence of registered symbols in a flowchart. If the registered sequence does not match that in the saved source code, then the original source text will not load properly into the flowchart. More advance version of LogicCoder provides functions that help you to manage these kinds of situations. |
||
CREATING THE ANSI C SOURCE PROGRAM |
||
|
STEP 1:
|
||
|
STEP 2:
|
![]() |
|
|
STEP 3: More advance versions of LogicCoder has functions that tells it to insert known include file headers in a generated C/C++ source program base on the use of command statements in the source code. STEP 4: STEP 5: STEP 6: |
||
|
Try dragging any symbol in the flowchart once the dialog window has disappeared from the document window. The flowchart symbols should not move whenever you attempt to drag them with the mouse. In the next step you will execute the function that writes the required C/C++ source program.
|
![]() |
||
|
STEP 7: STEP 8: |
|||
|
LogicCoder presents you with a series of message boxes that indicates where the program flowchart is stored on your system, diagnostic message that indicates connectivity of the flowchart and a message to indicate that the system is generating the required program. Make note of the location where the generated program is stored. When a source program is generated, it is stored in a text file with the name default to that of the flowchart file name except that the extension is that of the standard extension for the source language your system is set to.
|
![]() |
||
|
STEP 9:
Your source code should look similar to that illustrated in figure 22.
|
![]() |
||
|
(2) The top-down approach allow you to start with an abstract definition of a program problem, you identify specific components within the abstraction, repeat the process on these components until their description maps well onto statements within the domain in which the problem solution is to be implemented. The above explanation is an illustration of how you can do this with LogicCoder. In the next section that follows, you will learn how to
|
||
SAVING THE SOURCE CODE TEXT FILE |
||
|
The Code sub-menu consist of a set of functions that allow you to create source code files from a flowchart and to save and retrieve source code text view files for a given flowchart. You can also do chunk modification to a source code file by insertion of other code sequence such as data list or multiple comment lines. LogicCoder provides five basic ways in which you can create a flowchart by interconnection of symbols.
When you save a source code file, LogicCoder keeps track of the individual symbol to which each text string belongs. LogicCoder also store information that determines which source language the source code text file belongs to. LogicCoder do not allow you to load a source code text file into a flowchart that does not belong to the source language for which your system is currently set.
|
||
SETTING THE SYSTEM TO GENERATE A PROGRAM IN BASIC |
||
|
We have a different view of the way the system obtains its data values in the BASIC implementation of our program problem solution. This is because the data values used in the program are actually test data for the program. Actually, the final program is suppose to get its data values by reading data from an external device such as a magnetic storage medium. STEP 1:
This is it for now folks! If you want to continue with the tutorial, then you should download the pdf file. You can also download a free tutorial version of LogicCoder for ANSI C/C++ and BASIC programming which you will need to actually do the activities in the tutorial. Let me do know if you have any problem by sending a message to info@logiccoder.com. |
||
Go to the next sequenced page in this tutorial
Copy right © May 2002
Logic Code Generator
Tel: +44(0)794
EMail: info@logiccoder.com
| Home | Purchase LogicCoder | Programming Books | User interface | Example Flowcharts |