THE AUTOMATED FLOWCHART DESIGN AND CODE WRITING SYSTEM |
Home || Contact us || Create code logic ||xx |
What is a Computer Program Flowchart? |
|
INFORMATION ABOUT PROGRAM FLOWCHARTSIn this web page I attempt to help you understand the basic concepts and principles on which LogicCoder is built. With this knowledge, you will find it easier to appreciate the way LogicCoder works and your learning curve should be easier to climb. There are also useful information about Computer Program Flowchart, Program Logic Control Structures and the Program Development cycle. Use this link to convert your source code to LogicCoder and Ms Excel flowchart. |
DIFFERENCE BETWEEN AN ALGORITHM AND A CONTROL LOGIC |
||
|
Algorithms are usually more attached to a specific logic problem whereas a Control Logic is more attached to a device on which an algorithm is to be implemented. You can use a flowchart to illustrate a control logic as well as an algorithm. |
||
PRINCIPLES OF PROGRAM FLOWCHARTING |
||
This section gives a concise introduction to the concepts and principles of flowcharting as a means for illustrating program algorithms to be executed on digital computer systems. The main objective is to help you understand the basic principles on which LogicCoder operates and to provide you with a conceptual guide for design of your program algorithms. This on-line documentation is not intended to be a detailed practical guide. Reference sources that gives more practical learning material including programming language concepts and design techniques are given at the |
||
WHAT IS PROGRAM FLOWCHARTING? |
||
|
Flowcharting is the art of illustrating program algorithms graphically using standard symbols and their interconnection. A program algorithm is the sequence of logical steps that must be executed on a machine in order to derive the solution to a programming problem. There is no known standard accepted technique that restricts the design of program flowcharts using standard flowcharting symbols. In LogicCoder there are restrictions that the user must follow before program code can be generated by the system from a design. These restrictions may appear to be counterproductive when deriving the design for certain programming problems. In this case, the programming problem is usually trivial in nature. However, years of teaching and programming experience have shown that the advantages from the approach used in LogicCoder strongly outweigh the disadvantages. These rules ensure that all control logic structures are well defined, can be easily identified, edited or abstracted. In later version of LogicCoder we show how these rules are developed further to create data flow diagrams and for identification of parallelism in an algorithm. Hence, LogicCoder provides facilities for you to convert elements of a uni-processor algorithm to a parallel system. We define a uni-processor algorithm as an algorithm which when implemented on a Digital Computer System under the Stored Program Concept is executed in time sequence as determine by its flow of control logic. At any instance in time, the system is executing only one intended instruction or group of instructions associated with the flowchart logic. Each symbol in a flowchart except connectors and lines represents a process that can be implemented on a digital computer that operates under the stored program concept. In this system of flowcharting, there are only three basic kinds of control logic structures |
||
| An Explanation | Basic Form | |
| 1. Sequence - for executing a list of processes in time order. The two predefine symbols can represent any other complex processes such as other sequences or control structures consisting of loops or case structures as explained below. | ||
| 2. Loop - for repetitive processing in time order and and in control of a test condition. The loop control logic allow the same processing to be applied to a whole set of data values in order to arrive at a given solution for a processing problem. You can also have a sequence or another loop within the body of a loop or you can have a case structure. | ||
| 3. Case - for making decisions on alternative or complex selection processing. There are more complex forms of the case structure and there are specialized forms for doing multiple or switch type selection in a computer program. Either or both arms can also have a sequence, a loop or other case structures. | ||
|
Well folks! This is what program design is all bout! It is now up to you to make it as complex as you would like it to be. We have special variation of each of these three basic control elements. For example, a select case structure is a more complex but special form of the case structure. Any program implemented on a digital computer system by way of the stored program concept can be abstracted as a sequence of processes in time order. All loops have the same basic elements but can be used to implement complex processing consisting of other control elements such as a case structure or other loops. The manner in which these restrictions are implemented in LogicCoder are hinted at in the rules given in the following sections. |
||
ADVANTAGES OF FLOWCHARTS FOR PROGRAM DESIGN |
||
|
I have listed here, some of the advantages from using flowcharts.
|
||
FLOWCHARTING SYMBOLS |
||
| You show the flow of program control in a flowchart by connecting flowcharting symbols together in a systematic manner. Each non-line symbol except for connectors in the flowchart represents some processing to be done at that point in the program. Each symbol represents a specific kind of operation that can be done on the computer. The symbols illustrated below does not exhaust those used in many technical documentation on computer systems. Symbols used in some documentation are appropriate to the kind of operations on computer systems they are intended to represent. The set of flowchart symbols illustrated below are appropriate to the kind of operations implemented by LogicCoder. However, LogicCoder has variant of these symbols that represents operations unique to LogicCoder. The most commonly used flowcharting symbols and a brief explanation of their use is listed below. | ||
|
PROCESSING
|
|
|
| INPUT/OUTPUT
|
Indicates the point in the program where data is made available to the program through some input device or where processed data is made available for output from the program. LogicCoder provides additional Input/Output and Process symbols that can be used to illustrate more complex or specific kinds of Input/Output or Process operations in a flowchart. | |
| DECISION
|
Shows the point in the program execution sequence where a jump takes place base on the outcome of a tested condition. In LogicCoder, Decision symbols are used only for establishing loops, case and switch-case structures.
|
|
|
CONNECTOR
|
Shows the exit from a case, a switch-case control structure or a common point where two or more control logic merges to create a single flow path. LogicCoder uses two concentric circles to distinguish a normal connector from a Switch Case connector. The Switch Case connector is illustrated and explained below.
|
|
| TERMINAL
|
Shows the start or end point in the flow of control logic in a single flowchart. A complete flowchart must always have only one terminal symbol that indicates its beginning and a terminal symbol that indicates its termination. LogicCoder looks for a terminal symbol that indicates the start of the flowchart when doing an interconnection operation.
|
|
| PREDEFINE
|
Shows a series of predefined processes that can be encapsulated as a single process and therefore represented as a subroutine, i.e. function, procedure or method. LogicCoder also uses the predefine symbol to represent an abstracted control structure. The detailed logic of the control structure is preserved. | |
| INTERNAL STORAGE
|
Shows an output operation where data is stored internally on the computer system. This storage is usually on a mass storage device such as a Hard disk or CD ROM. LogicCoder does not use this symbol.
|
|
| PAGE CONNECTOR
|
Used in multi-page documents to show the point in the program logic where control is pass from the logic on a given page to the logic on another page. Use this symbol when you need to restrict the size of your flowchart document. This may be due to the fact that you ant to print your flowchart on a printer that is restricted. However, LogicCoder will not be able to connect a flowchart that uses the off-page connector symbol.
|
|
ARROWS
|
Shows the flow of program control or data flow. Flow-lines can have any one of four directions. LogicCoder does not use arrows to determine the flow of control logic in a flowchart. The way this is done is explain further on in the manual. LogicCoder provides a function that you can use to see the flow of control logic in a flowchart as determine by LogicCoder.
|
|
COMMENT
|
Used to show points in the program logic where comments are written for the purpose of internal documentation. LogicCoder insert comments written in this symbol into the generated source program.
|
|
|
Special compound symbols used by LogicCoder |
||
| LOOP DECISION |
A Loop Decision constitute the Entry/Exit point to a loop control structure. You use the Loop Decision symbol to quickly draw this point in a flowchart. You must then use the Fragment Structure function in LogicCoder to break this symbol into its constituent.
|
|
| CASE DECISION |
A case decision constitute the entry point to the case structure. Use this symbol whenever you want to quickly draw a case structure in a flowchart. Use the Fragment Structure function to break this symbol into its constituent before you try to write a source program with LogicCoder.
|
|
| EXIT CONNECTOR |
The Exit Connector is the exit point in a case or Switch-Case structure. A Case or Switch-Case structure must always have only one exit point indicated by the exit connector. Use the Fragment Structure function to break this symbol into its constituent before you try to write a source program with LogicCoder.
|
|
ADDITIONAL SYMBOLS USED BY LOGICCODER |
||
|
|
||
CONTROL ELEMENTS OF A PROGRAM LOGIC |
||
|
The ability of the computer to fetch and execute instructions repeatedly, accurately and at very high speed coupled with its ability to make decision on alternative processing makes the computer appears to be a powerful device. The programmer writes code in a programming language that specifies what instruction is to be executed in a program. The kind of processing done by the basic control elements that determine branching during the sequence of program statement execution can be described as:
Actually, both type of processing is base on a process of decision making. The difference is that the control path in one case does not lead to a repeat of processing done before. Alternative processing in a program is implemented using the control logic known as the case structure or the comparing logic structure. Loops are implemented using the loop logic structure. |
||
EVALUATING THE CONTROL LOGIC IN A FLOWCHART |
||
|
When interpreting the logic of a flowchart, traversal of this logic is 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 that 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. EXAMPLE |
||
| The implementation code in a source programming
language is the actual instructions to the computer system that causes the
intended processes to be executed by the system. In most case, the source
code consist of high level instruction code that must be translated to machine
level code before the program can be executed on a computer system. Some
high level source language are specialize in their application and provides
facilities to the programmer that results in convenient code development.
When developing the logic of a software system to be implemented in a target source language, you should be aware of the available facilities in that source language. |
![]() |
However, with LogicCoder, you no longer need to be too concerned about details of the implementation control structures in the language once you have completed a proper design using a flowchart. The logic illustrated by a flowchart is then used to write the program solution in a selected programming language. For example, the logic illustrated by the flowchart in above can be implemented in C as illustrated below. Notice that the code does not deal with programming issues such as systems environment setting and preprocessing directives. These requirements are not documented in the flowchart. |
|
THE C/C++ PROGRAM CODE |
| The programming language used to code the program logic will to a large extent be determine by the nature of the descriptive statements used in the flowchart and the nearness of their meaning to specific statements that can be implemented in a language that fits closely to these description. If the program logic is well-designed, then the implementation source code can be any programming language. | ![]() |
| Therefore, good algorithmic description in a program flowchart is essential to good program documentation, maintainability and portability of their implementation. The illustration below is the implementation code in BASIC for the program flowchart illustrated above. Coding a program is an exact skill that a programmer must develop by paying careful attention to detail and the precise use of the syntax of a programming language. However, with LogicCoder you need not pay much attention to the syntax of a programming language. | |
THE BASIC PROGRAM CODE |
|
Certainly! it is possible to implement the logic of a flowchart in Assembly Language using LogicCoder. In this case, the description of events illustrated in the flowchart would in most case refer to the hardware elements in the system on which the program algorithm is to be implemented.
|
![]() |
|
Click the following link to see example program problem control logic illustrated with the use of flowcharts with source program in BASIC/or ANSI C/C++ generated by LogicCoder. There is also a free sample download of an evaluation version of LogicCoder with sample copy of these flowchart. |
|
FLOWCHARTING AS IMPLEMENTED IN LOGIC CODER |
||
LogicCoder implement the rules listed below. In addition, LogicCoder provides means whereby you can quickly generate source code in multiple source languages using a given flowchart. You can do easy modification to the existing logic of a software system and then generate new source code base on your modification. You need not pay much attention to the semantics of programming languages or the use of control statements in order to develop and implement complex logic systems. You can also easily port logic design from one source language to another whilst using the same system documentation. |
||
BASIC RULES OF LOGIC CODER |
||
|
|
||
DRAWING A FLOWCHART |
||
|
The tutorial Manual gives lessons to illustrate these three methods for drawing a flowchart. Click the following link to see sample screen shots within a tutorial that teaches you how to use LogicCoder to draw a computer program flowchart for a problem solution. You can also download a free copy of this tutorial in pdf form along with a Windows version of LogicCoder for ANSI C/C++ and BASIC. |
||
CORRECTNESS OF LOOPS AND CASE STRUCTURES |
||
|
Using the branch point principle given in LogicCoder may appear to be inefficient in the first instance. However, over the long term you will find that it is a highly productive restriction that avoids the development of complicated or difficult to edit control logic structures. The example flowchart below illustrates a temptation to violate the basic loop design principle. In this algorithm, a data file is to be used to create a report by repetitive processing of its records. |
||
| The alternative but incorrect logic implementation is illustrated below. The justification to use this implementation is that in looping this way you save on unnecessary coding. However, this is not the most efficient technique for saving on program code over the long run. In addition, "saving on program code" does not always result in a more efficient program. Using well defined control structures in a program design is a better aid to discovering ways for implementing efficient and correct program code. Because of the importance of the basic loop logic structure, two "Read a Record" processing statements are required in the program source code. | ![]() |
To pass back program control to the first command statement as illustrated in the figure below violates the rules of the loop control structure. In this implementation, the first statement in the loop is not a decision. The correct implementation follows the rule that the first statement in a loop should be the decision that determines whether the body of the loop is to be executed or not. The value of this rule is not immediately apparent in this simple example. It takes more complex algorithm to realize the soundness of this rule. More advance version of LogicCoder allow you to implement the do-while loop in a structured and consistent manner. See our technical and our user refence manuals for more detailed information. |
|
|
The control logic used to implement a loop must be explicitly determine to be that of the while or do-while loop. A do-while looop control logic must not be used for the sole purpose of saving coding statements or for the sole purpose of simplifying a control logic. The information given in these example flowcharts is only intended to be a guid of the facilities available in LogicCoder's Technical Reference Manual. This information is incomplete. More detailed explanation of program flowcharts can be found in our teaching resources and the Technical Reference Manual. |
![]() |
A STRUCTURED APPROACH TO PROGRAMMING |
||
LogicCoder supports a structured approach to the development of software systems. LogicCoder makes it easier for developers to document and maintain their software systems with less uncertainty, more consistency and greater control over the management of changes. Hence, both design and program maintenance are made easier. Correctness of a program can more easily be aligned with its algorithmic description. Structured programming languages generally emphasize the use of well-established control statements that implement well-established control structures. The layouts of program code in these languages emphasize and make it easy to deduce these control structures. This helps to enhance the readability of the program logic and the maintainability of the program code. LogicCoder generates code in conformity to these basic principles. However, you no longer needs to pay attention to these details when developing software systems. |
||
THE PROGRAM DEVELOPMENT CYCLE |
||
|
1. Review of program specification |
||
REVIEW OF THE PROGRAM SPECIFICATION |
||
|
The solution to a programming problem begins with a clear description of the problem to be solved. This includes the following:
A clear understanding of the program specification should be the basis for the programming problem solution. At this point, the programmer should have no doubt as to the format of the input data, the processing to be done to them and the format of the output from the program. |
||
THE PROGRAM DESIGN |
||
| Correct programming is base on a scientific principle. The design of the program logic is in keeping with the set of program specification derived from the program review. The programmer must have knowledge and understanding as to how a given objective in the program specification can be implemented on a computer system. | ||
THE PROGRAM CODING |
||
| The programmer uses the flowchart to code the program logic in an appropriate programming language. The descriptive statements used by the programmer in the flowchart in most case will be influence by the programming language to be used for implementation of the programming solution. If the program logic is well designed, the programmer should be able to code the program in any programming language and still obtain the correct results. Therefore, good algorithmic description in a program flowchart is essential to good documentation, maintainability and portability of their implementation. Coding a program is an exact skill that the programmer must develop by paying careful attention to detail and the precise use of the syntax of a programming language. | ||
THE IMPORTANCE OF PROGRAM REVIEW |
||
|
It is possible that a programmer from time to time will make errors in the logic design of a programming problem solution or in the syntax use of a programming language. Therefore, it is important that other programmers review a program before it is entered into the computer system. The program review is best done by people other than the programmer. A program review is not an exercise to critiqued a program, but an opportunity for classmate, or quality control people to benefit as a result of the following:
Copy right © May 2002 |
||
| On-line Tutorial | Books | About Programming | Partnership Programme | About Sorting |