|
Get more detailed information about the
use of flowcharts to design and document program problem solution.
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.
- Structured Programming with BASIC I; ISBN 0-9544270-1-7; Price $44.00 USD
- Structured Programming with ANSI C; ISBN 0-9544270-0-9; Price $56.00 USD
- Object Oriented Programming with ANSI C++; ISBN 0-9544270-3-3; Price $66.50 USD
LOGICCODER AS A GENERIC SYSTEM
LogicCoder provides the following facilities that allow you to easily
design, implement and use generic control logic structures to develop
complex software systems accurately and quickly.
IGNORE STATE FOR SYMBOLS:
You can switch selected symbols into or out of an ignore state when generating
a source program from a flowchart logic. When you place a flowchart symbol
in the Ignore state, LogicCoder ignores the symbol when generating a source
program from the flowchart logic. You can switch the symbol back to the
normal state whenever you require. A null statement is inserted into the
generated source program instead of the command statement in the flowchart
symbol. You can not place a VLine, HLine, Connector, Terminal or Decision
symbol in the ignore state.
INDETERMINATE SYMBOLS AND TEMPLATE STRUCTURES:
An indeterminate symbol is a symbol which type is unknown. This should
not be confused with a symbol in the Ignore state. A symbol in the ignore
state is any symbol that represents a process that can be described or
implemented in a source language. When a symbol is in the Ignore state
it becomes invisible to LogicCoder during source code generation. In this
state, the symbol still has its original representation. However, an Indeterminate
symbol is a symbol that does not represent any process but can be changed
to any symbol that can be used to describe a process. Indeterminate symbols
are used mainly in template structures to represent generic processes.
THE CHANGE SYMBOL MENU OPTION:
LogicCoder provides the Change Symbol Type function that allows you to
change selected symbols type in a flowchart. For example, you can change
a Processing symbol to an Input/Output symbol and so on. You can select
a single symbol or group of symbols and do change to a single type. Therefore,
you can use the existing logic of a flowchart to quickly implement a similar
solution to a problem that requires slight changes in the kind of operations
to be done.
SELECT AND ABSTRACT CONTROL STRUCTURE:
LogicCoder allows you to select a control structure within a flowchart
logic and then abstract this control structure to a single flowchart symbol.
You can also do the reverse. That is, you can expand the abstracted representation
of an abstract predefine process to view the actual implementation logic.
Therefore, if you have a complex control logic you can select and abstract
control elements to create an overall control structure that is conveniently
generic in form and that is easier to evaluate.
INSERT CONTROL STRUCTURE:
LogicCoder provides generic control structures that implement standard
control logic. You first select a point in the flowchart where you want
to insert a standard control logic. LogicCoder then allows you to select
and edit the generic control structure to fit a specific requirement.
Once you are finish editing the control logic structure, LogicCoder does
necessary shifting of existing symbols in the flowchart and then inserts
the control logic.
CREATE FLOWCHART FROM A TEMPLATE STRUCTURE:
LogicCoder provides several means by which you can quickly build complex
flowchart algorithms. You can edit a template control structure to create
solutions to many different programming problems of the same kind. You
can also create your own template structures and then use them as required
in your logic design. Template structures represent generic control logic.
Later versions of LogicCoder allow you to insert a template structure
as an abstracted predefined control logic. You always edit the template
structure so that it implements a specific program logic solution before
you save it as a flowchart.
SAVE FLOWCHART AS TEMPLATE STRUCTURE:
LogicCoder provides you with the Save As Template function in the File
pull-down menu that allows you to save a logic design as a template structure.
In this case, each symbol that represents a process in the flowchart is
changed to the Indeterminate symbol. Therefore, the control logic determines
the generic structure. In this way, you can derive the solution to a class
of programming problems that have the same form in their control logic
by deriving the solution of one such problem. You then edit the generic
control logic to implement the solution for any problem within that class
of programming problem. Symbols that represent a process in a flowchart
are as follows. Input/Output Process Predefine Comment
MULTIPLE SOURCE CDE TEXT FOR A SINGLE FLOWCHART:
LogicCoder allows you to create more than one source program in a source
language from a single control logic design. Therefore, you can have multiple
source code views for a single flowchart. You select to save the source
code text of a flowchart once you have created it. You can then empty
the flowchart of its language source text and then create a new source
code text using the same or a modify control logic. You choose to load
a source code text file in order to do editing to it or to write a source
program using the flowchart logic. However, you should note that once
you change the control logic of a flowchart, if you then attempt to load
the source code text file, source command statements may not be allocated
to each symbol in the correct original sequence. In addition, any new
symbol you insert into the flowchart will not have text stored in it.
I.e. they will appear empty.
INSERT STANDARD CONTROL STRUCTURE:
LogicCoder provides standard control structures that you can insert at
selected points in a flowchart. You select a point in a flowchart to insert
a control structure. LogicCoder then allows you to edit the structure
to fit a specific requirement. You can also create your own control structures
and then use them as required in your logic design. Control structures
like templates represent generic control logic. Later versions of LogicCoder
allow you to insert a template structure as an abstracted predefined control
logic. .
LOGICCODER USER INTERFACES
The original design for LogicCoder is intended for implementation on
multiple operating systems. Current implementations are designed with
a Graphical User Interface (GUI) that runs in a purely DOS or Ms Window
environment. The following is a description of LogicCoder Ms Windows GUI.
LogicCoder user interface consists of standard Ms Window GUI objects
for common Ms Windows type file operations. As can be seen in the following
diagram, the top pane of the main user application interface consist of
a standard application menu bar, followed by a familiar Windows type tool
bar. This tool bar has icons for familiar document operations such as
New document, Open document and so on. On the right hand side of this
toolbar is a flowchart template. This template is a subset of the flowchart
symbols available in LogicCoder.
There is also a flowchart template bar with standard ISO flowchart symbols
as illustrated in the following image. GUI objects are designed to respond
to standard mouse events in a familiar way. A shortcut menu bar is a list
of shortcut buttons for performing common task on flowchart symbols within
a document or on the text content of symbols. The shortcut toolbar is
divided into two sets of editing functions. Those that do editing to symbols
in a flowchart and those that do editing to the text content of flowchart
symbols.

THE GRID-LINES SUB-MENU OPTION
LogicCoder provides a grid consisting of vertical and horizontal lines
in a document. The grid acts as a layout guide to the user. However, you
can choose to switch on or off this grid system by selecting the Grid
Lines menu item in the View pull-down sub-menu. Alternatively, you can
use the shortcut button on the Toolbar.
HOW TO SWITCH ON OR SWITCH OFF THE GRID LINES
Ø Select the View menu option on the main menu bar by clicking with the
left mouse button or use the Right/Left arrow keys to highlight it and
then press the Enter key once.
Ø Use the mouse left button to select the Grid Lines sub-menu item or
use the Up/Down arrow keys to highlight it and then press the Enter key
once. If the grid lines are visible, they will disappear from the screen.
If the grid lines are not visible, they will appear on the screen.
In addition, the Grid line shortcut button appear sunken whenever the
grid lines are visible and un-sunken whenever the grid lines are not visible
as illustrated in figure 39. This menu option toggles like a switch. Therefore,
you can switch it off by selecting it again in the manner stated above.

The following image describes the main user interface of the Ms Window
version of LogicCoder. See figure 2 in user reference manual for more
detailed information of each item on the shortcut edit toolbar.

USER HANDS-ON ACTIVITY
Execute the LogicCoder application and examine those elements of the
screen display in your application window to those displayed in the above
images. Do not expect to see a copy of the flowchart document as in this
diagram!.
EVALUATING THE CONTROL LOGIC OF A FLOWCHART
When evaluating the logic of a flowchart, traversal of this logic is
done from top-to-bottom, left-to-right, both right-to-left and left-to-right
at case decisions, and bottom-to-top followed by right-to-left when terminating
a loop. Therefore, evaluating the logic in a control structure can be
determined by the basic rules that govern the structure. For example,
the logic in a loop can be evaluated on the basis of the basic loop logic
structure along with any other nested internal structures. We use an example
program flowchart to illustrate these points.
FLOWCHARTING IMPLEMENTED BY LOGICCODER
The system of flowcharting used by LogicCoder to illustrate the control
and execution of a program on a computer system is concise and structured. There
are rules that govern the ways in which you use the functions provided
by LogicCoder. These rules are logical and consistent and in most case
are intuitive to follow. LogicCoder implements the rules listed below.
RULES YOU MUST FOLLOW WHEN USING LOGICCODER
The following are rules that you must follow when designing program algorithms
with the intent to generate source code. To generate a source program
from a flowchart, LogicCoder must first determine that the flowchart is
correctly connected together. LogicCoder is design to determine the flow
of program control in a flowchart without the use of arrows. However,
the following restriction results as a consequence.
Two or more symbols are connected whenever they overlap. Only line and
non-line symbols should be interconnected in a flowchart. Any other kind
of interconnection results in an interconnection error. Since no rotation
on symbols is allowed overlapping can only occur with specific orientation
of any given pair of symbols. Overlapping is two-dimensional and occurs
only when the following conditions are satisfied:
CORRECTNESS OF SYMBOL INTERCONNECTION
Ø Any selected point within the region of overlap is common to both symbols.
Ø Two non-line symbols must never overlap in a flowchart.
Ø Only line symbols or line with non-line symbols can overlap. Any other
kind of overlapping is illegal and will generate an error message during
a correctness check on the flowchart.
Ø A sequence of interconnected processing starts with the topmost symbol
and terminates at the bottom or starts with the leftmost symbol and terminates
at the right.
CORRECTNESS OF CONTROL STRUCTURES
Ø Single Entry and Exit point principle for case structures and loops
Ø Every control structure must have a single entry and a single exit point.
Ø The Entry point to a case, a switch-case or a loop control structure must always be a decision
Ø A loop control structure except for the do-while loop has its entry and exit points at the decision
Ø A switch-case structure must have a single vertical line that follows
a decision symbol. This VLine symbol must be followed by a single HLine symbol.
Ø The number of available path through a switch-case structure must be
the same as the number of exit paths that terminates with VLines connected
to HLines that terminates on the switch-case connector.
CORRECTNESS OF LOOPS
Ø Lines must not overlap or intersect each other unless there is a pass
of control from one to the next. For example, in the case of a loop where
a single horizontal line terminate the loop on a vertical line. The vertical
line passes control to a Decision symbol that forms the exit point of a standard loop.
Ø The exit point from a standard loop must also be the entry point.
Ø The exit point from a case structure must always be indicated by a connector symbol.
Ø Loops can not be left-handed
Ø The flow of control in a loop can only be from top-to-bottom. Control
can not be from bottom to top unless a loop is been established where
part of a loop moves up to terminate at its entry point.
Ø The entry point in a do-while loop must not be a decision.
Ø The exit point in a do-while loop must be a single decision.
Ø No symbol must be connected on the feedback path of a do-while loop.
In addition, you must adhere to the following rules in your design layout.
CORRECTNESS OF NESTED STRUCTURES
Ø A nested loop is contained completely within its outer loop. Control
is never pass from a command within the inner loop to a command in the
outer loop until the inner loop exit.
Ø A loop within a case or nested-case structure is completely contained
within the case or nested case structure. Control within the loop is never
pass outside of the enclosing case structure. Control is pass to the case
structure only through the exit point of the loop.
Ø A case structure within a loop or a nested-loop is completely contained
within the loop or nested-loop. Control from the case structure is never
pass to the loop. Control to other points within the loop external to
the case structure is only pass through the exit point of the case structure.
Ø A case structure always has its entry point at a decision.
Ø The exit point of a case structure is indicated by a connector symbol.
Therefore, the number of connector symbols must be the same as the number
of case decision symbols. I.e. every case decision has a corresponding
connector at its exit point.
Ø A nested case structure within another case structure is completely
contained within the outer case structure. Control is never pass to the
outer case structure until the inner case structure exit.
ELEMENTS OF THE LOOP LOGIC STRUCTURE
The loop logic is used to implement code that does repetitive processing.
A repetitive process consist of a set of instructions that are executed
repeatedly base on the outcome of a tested condition. The tested condition
is written as an expression in the source language. You place this control
statement in the source code view of a decision symbol in a flowchart.
LogicCoder examines this control statement to determine which loop control
statement to use to generate the source code. LogicCoder also examines
the structure of the loop logic to determine the proper control statement
to use in the source code. The while and the for-next statements are used
to implement the control logic of the standard loop logic structure. The
basic elements of the loop control logic are illustrated in figure 5.

A loop is the correct control structure to use when a sequence of operations
on the computer system is to be repeated a number of times until a given
condition occurs. Flow of control, into a loop decision, within the body
of the loop and out of a loop branch point. The flow of control through
interconnecting lines at a loop decision must always be at the points
and in the directions illustrated here. This is also the case in a do-while loop

INCORRECT FORMS OF BRANCH POINTS IN A LOOP
LogicCoder allows you to design flowcharts that implement any kind of
known or unknown loop structure. However, LogicCoder will not be able
to interconnect and therefore generate source code from a loop that is
not implemented with the branch point structure illustrated in the above.
Examples of incorrect branch point structures are illustrated here.

TERMINATING A LOOP FEEDBACK
You must not terminate a do-while or the standard loop control logic on
any symbols other than a VLine. The illustration in figure 13 shows examples
of invalid do-while and standard loop termination. LogicCoder uses a standard
algorithm to determine a loop construction. If a loop is not correctly
terminated, this evaluation can result in unpredictable results.

FORMS OF BRANCH POINTS IN A CASE STRUCTURE
The flow of branch points from a decision in a case structure is distinctively
different from those in a loop decision. Hence you can easily distinguish
between both structures in a flowchart. The general format for the flow
of control in and out of a case decision is illustrated as follows.

There is only one entry into the top of the decision and
two exits, one on the left and one on the right side of the decision.
You must not have an exit below the decision. You will quickly observe
from the sample flowcharts provided with LogicCoder that it is relatively
easy to isolate sections of a complex logic structure within a flowchart.
An isolated structure has a definite control structure by its self. The
sample control logic in the following are examples of invalid control
structures for the case branch point.

A case control logic should not be used to implement a loop
as the first example in figure 16 suggest (1). Passing loop-back control
to the entry point of a case control structure results in a confused control
logic. In addition, LogicCoder is not able to evaluate such structures
and will instead issue an error message and then terminate any operation
that requires flowchart connectivity. Similarly, if a user were to implement
a correct control structure that has a single entry and a single exit
points but uses the flow of control as illustrated in the next two examples
in figure 16, (2) and (3), LogicCoder would not be able to evaluate these
structures. You should not pass either branch points of two separate case
structures into a single path. The path followed by each branch point
for a set of case structures must be separate and easy to identify. Flow
of control along a branch point in a case structure must only result from
a single decision at the start of the structure. Control must not pass
to any instruction within a sequence that does not form part of either
leg on the structure. Passing of control to instructions external to the
structure can only take place whenever exit from the structure occurs.
THE SWITCH-CASE STRUCTURE
There are programs in which the required processing at a given point in
the control logic is to be determine by a sequence of decisions implemented
by a sequence of nested case structures using a single control variable.
Modern programming languages provides a control command statement that
simplifies the implementation of this kind of nested case control structure.
This multilevel nested case structure is called the switch-case structure.
It has the general format illustrated in the following image. Note that
the switch case structure also have single entry and exit points as with
the case structure. The decision used in this case acts as a switching
point in the control logic. It passes control to the appropriate sequence
of command statements base on the value of a control variable.
The switch case structure is a fine example of an abstracted view of
a complex control logic structure. It is a generic control structure that
has wide application. LogicCoder provides functions that allow you to
abstract your own control logic structures and use them as templates for
building other complex control logic structures. When drawing the switch-case
structure there must only be three HLine symbols that enclose the execution
paths through the structure. One that connects the entry to the execution
paths in the structure and the two that flows into the connector symbol.
You should always ensure that this is the case whenever you draw the structure.
DRAWING A FLOWCHART
The previous section gives a basic idea of the paradigm on which LogicCoder
is base. This section gives more specific instructions on how to use LogicCoder
to draw descriptive program algorithms and how to use the flowchart to
generate implementation code in a selected programming language.
SELECTING SYMBOLS TO DRAW A FLOWCHART
LogicCoder provides different ways in which you can create a flowchart
by interconnection of symbols. You can draw symbols in a flowchart document
using any of the following methods. The tutorial section in this manual
provides lessons that illustrate these methods for creating a flowchart.
HOW TO USE THE FLOWCHART SYMBOL TEMPLATE BAR
Ø Use the mouse to select the symbol you want on the flowchart template
bar and then click symbols in its location in the flowchart. You select
the point in the flowchart document where you want the symbol to appear
by clicking with the mouse left button.

When you select a symbol on the symbol template bar, the selected symbol
appears sunken as illustrated in the above image. If you then click the
flowchart document view, any of the following will occur depending on
where you click.
1. LogicCoder draws a copy of the current selected symbol with centre
at the point where you click. A symbol is selected immediately after it
is drawn. Therefore, you can move the symbol by pressing the mouse left
button and then drag in the document view in the direction you want to
move the symbol.
2. The symbol at the location you click is selected. When you do a mouse
left button click, LogicCoder first check to determine if a symbol is
at the mouse click point. If a symbol exist at the mouse click point,
it is selected. Else if a symbol is selected on the template bar, a copy
of the selected symbol is drawn at the mouse click point in the document
view.
HOW TO USE A FLOWCHART CONTROL LOGIC TEMPLATE
Ø Insert control structures into an existing flowchart or edit a template
structure to create a problem solution.

You edit a template structure or a standard control structure
by replacing each Indeterminate symbol with proper flowchart symbols.
The above image illustrates an example Template structure that can be
edited to create a new flowchart. You must replace all Indeterminate symbols
in a Template structure with proper flowchart symbols. Otherwise LogicCoder
will replace them with lines whenever you save the flowchart or do certain
other operations on the flowchart. When you select to create a flowchart
from a Template structure, LogicCoder deletes the flowchart you currently
have opened. Therefore, you should save this flowchart before you select
to create a new flowchart from a Template structure.
SELECTING SYMBOLS IN A FLOWCHART
LogicCoder provides you with several alternative means for
selecting symbols in a flowchart. You may want to select group of symbols
base on the operation you wish to perform on them. For example, you may
want to select a sequence of symbols that constitute a control structure
that you want to abstract to a predefine symbol or you may want to select
a set of symbols to write common text to them.
You select a symbol in a flowchart by clicking with the
mouse left button. A symbol is selected if the point that you click falls
within the area taken up by the symbol. You can also select symbols in
a flowchart by tabbing. When a symbol is selected, it appears with an
outlined rectangle around it as illustrated by the examples in figure
31. The colour of the symbol also changes from black to blue.
You drag within the rectangular region of a symbol in order to move the
symbol. You can also move a symbol by selecting it and then pressing the
appropriate arrow key for the direction in which you want to move the
symbol. You can also move a group of symbols with each symbol kept in
its relative position to other symbols in the group.
SELECTING MULTIPLE SYMBOLS
You can select more than one symbol with the mouse by pressing the Shift
key and then click each symbol you want to select. You must first select
the Auto-draw mode button before an attempt to perform this operation.

Press the Shift key on your keyboard and then click each symbol you want
while keeping the shift key down. Each selected symbol appears with a
gold outlined rectangle around it.
You can also select more than one symbols by liaison with the Mouse.
Press and drag the mouse left button so that the outlined rectangle that
appears covers the set of symbols you want to select as illustrated by
the example
PLEASE GET A HARD COPY OF LOGICCODER TECHNICAL AND USER REFERENCE
MANUAL FOR MORE DETAILED AND CONCISE INFORMATION ON THE TOPICS HEREIN. |