The document discusses tools for formulating program logic, including flowcharts and algorithms. Flowcharts use graphic symbols to illustrate the sequence of operations to solve a problem. Algorithms are precise step-by-step methods to allow computers to solve problems. Effective flowcharts and algorithms break problems down into modular structures and use top-down design.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
166 views5 pages
Unit 1 Lesson 3 Flow Chart
The document discusses tools for formulating program logic, including flowcharts and algorithms. Flowcharts use graphic symbols to illustrate the sequence of operations to solve a problem. Algorithms are precise step-by-step methods to allow computers to solve problems. Effective flowcharts and algorithms break problems down into modular structures and use top-down design.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
UNIT 1 LESSON 3 (LOGIC code for a program before
FORMULATION) implemented in a specific program.
Program Logic FORMULATION PROGRAM: actual code written for problem succeeding all the rules of provides tools needed to design right the programming language solution by helping you define and identify the problem, requirements FLOWCHART and instructions. Graphic representation that The two most used tools to formulate illustrates the sequence of a better solution operations performed to get the solution. are: flowchart and algorithm. Visual representation of ALGORITHM algorithm. List of steps for solving a problem SPECIAL SYMBOLS Methodological approach, a Variable- memory cell used for precise, step-by-step process that storing a program’s input data and permits the computer to solve computation results problem. Often the most challenging part of Example: int a, b, c; the problemsolving process Top- Constant- contain a value that does down design (also called as divide not change and conquer). Example: Long width = 5; ALGORITHM STEPS IN SOLVING A PROBLEM: Note: variables that hold a number must be initialized by equating it to 1. Initialize data zero, and variables that will keep 2. Read/input data words may initialized by equating it 3. Perform computations to space and enclosed it in double- 4. Display/output data quotes (name””) Remember: PSEUDOCODE: simpler version of programming code in plain English, which uses short phrases to write TYPES OF FLOWCHART PREPARATION SYMBOL (HEXAGON) PROGRAM FLOWCHART -instructions that will alter, or modify operations such as control, index defines graphically the logical registration, switch setting, operations and stages within a initialization, and loops. program. TERMINAL SYMBOL (OVAL) SYSTEM FLOWCHART -used to designate the beginning and graphical procedures involved in the end of a program, or a point of converting data on the input interruption. media to data in output form. represents interactions among -can be used for stipulating error data, hardware, and personnel. situations
FLOWCHARTING SYMBOLS PREDEFINED PROCESS SYMBOL
(RECTANGLE WITH TWO VERTICAL Input/Output Symbol BARS) (Parallelogram) -represents an instruction to an -specialized process symbol that input or output device. represents a named operation or programmed step not explicitly PROCESSING SYMBOL (RECTANGLE) detailed in the program flowchart. -program instructions that -subroutine symbol, it can be used accomplish a program’s processing when a procedure needs to be function, e.g. performing arithmetic repeated several times. operations. ON-PAGE CONNECTOR (SMALL DECISION SYMBOL (DIAMOND) CIRCLE) -point in computer program where - a nonprecessing symbol used to more than track can be taken, a connect one part of a flowchart to branch to alternative path is possible. another without drawing flow lines. - It signified an entry or an exit from another part of the flowchart and used to change the reading order on the same page. FLOW DIRECTION INDICATORS 5. All the symbols except the (ARROWHEADS) diamond may have only one indicator branching out, but may have one or - show the direction of the processing more arrows branching in; of data flow. 6. Whenever circles are used, the OFF-PAGE CONNECTOR (SMALL symbol leading to the circle should PENTAGON) flow to the symbol where a circle -appoint entry or exit from a page containing a similar character is when a flowchart requires more than leading to; one page. 7. The sequence of a procedure using FLOW LINE (HORIZONTAL/VERTICAL symbols matters because it indicates LINES) the logical steps to be followed; -used to showing reading order or 8. A flowchart may contain many sequence in which flowchart symbols symbols of the same kind depending are to be read on the solution of the problem; -often used with arrowheads 9. Straightforward flowchart is advisable and most efficient. GUIDELINES FOR PREPARING A FLOWCHART FLOWCHART DEVELOPMENT
1. A flowchart always begins with -The program that executes this
START and is completed by END flowchart is likewise in an orderly, symbol; understandable, and transparent way. 2. Symbols are interconnected using arrows; STRUCTURED FLOWCHART
3. Use comma (,) to separate data, - an orderly, legible, and exact
and use a semicolon (;) to separate solution. instructions; Structured flowcharts are designed 4. The arrowhead indicates the using the direction to be followed; FOUR PROGRAM STRUCTURES: Advantages of Using Modules a) SEQUENTIAL ✓ Simpler Code - steps are performed in a strictly ✓ Code Reuse sequential manner and are executed once. ✓ Better Testing
- simplest method of control. ✓ Faster Development
b) SELECTION ✓ Easier Facilitation of Teamwork
- execution of instructions by section, TOP-DOWN DESIGN
wherein conditions for a series of -The overall task that the program is alternative statements are evaluated to perform is divided into a series of to specify which instruction is to be executed. subtasks.
c) REPETITION - It consists of -Each of the subtasks is evaluated to
repeating steps on more than one set determine whether it can be further of data broken down into more subtasks.
d) MODULAR STRUCTURE This step is repetitive until no more
subtasks can be recognized. The approach is sometimes called divide and conquer because an -Once all of the subtasks have been enormous task is split up into several identified, code will be written. smaller tasks that are easily CALLING A MODULE performed. -A module definition specifies what -A structure chart, also is known as a the module does and must be called hierarchy chart, shows the functional to execute. flow through the different modules in -When a module is called, the control a program. jumps to that module and then executes the statement in the body of the module. FLOWCHARTING A PROGRAM WITH MODULES -A module call is shown in a flowchart with a rectangle with vertical bars on each side. -The name of the module that is being called is written on the symbol. FLOWCHART TRACING -To determine the correctness of logic flow within any given flowcharting, it will usually require some tracing and testing.