0% found this document useful (0 votes)
209 views

Introduction To Flowcharts and Algorithms

The document introduces flowcharts and algorithms. It defines what a flowchart is, its importance in programming problems, and some standard symbols used in flowcharts. Guidelines for properly constructing a flowchart are provided, including starting and ending points, logical ordering of steps, and use of decision symbols. An example flowchart for calculating the average of two numbers is given. Finally, an exercise is presented to write an algorithm and draw a flowchart to calculate the area of a rectangle.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
209 views

Introduction To Flowcharts and Algorithms

The document introduces flowcharts and algorithms. It defines what a flowchart is, its importance in programming problems, and some standard symbols used in flowcharts. Guidelines for properly constructing a flowchart are provided, including starting and ending points, logical ordering of steps, and use of decision symbols. An example flowchart for calculating the average of two numbers is given. Finally, an exercise is presented to write an algorithm and draw a flowchart to calculate the area of a rectangle.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab 2 Introduction to Flowcharts and Algorithms Name: __________________________ Lab 2 aims at introducing you to flowcharts and emphasizing on algorithms.

PART I: Introduction to flowcharts A flowchart is a graphical representation of an algorithm. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Once the flowchart is drawn, it becomes easy to write the program in any high level language. Often we see how flowcharts are helpful in e plaining the program to others. !ence, it is correct to say that a flowchart is a must for the better documentation of a comple program. "lowcharts are usually drawn using some standard symbols# however, $tart or end of the program %omputational steps or processing function of a program &nput or output operation 'ecision ma(ing and branching %onnector or )oining of two parts of program

The following are some guidelines in flowcharting* a. &n drawing a proper flowchart, all necessary requirements should be listed out in logical order. b. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity in understanding the flowchart. c. The usual direction of the flow of a procedure or system is from left to right or top to bottom. d. Only one flow line should come out from a process symbol.

or e. Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol.

f. Only one flow line is used in con)unction with terminal symbol.

h. &f the flowchart becomes comple , it is better to use connector symbols to reduce the number of flow lines. Avoid the intersection of flow lines if you want to ma(e it more effective and better way of communication. i. +nsure that the flowchart has a logical start and finish. ). &t is useful to test the validity of the flowchart by passing through it with a simple test data. PART II: E am!le of a flowchart: ,roblem -* .rite an algorithm and draw the flowchart for finding the average of two numbers Algorithm* &nput* two numbers and y and y &nput $TA5T

Output* the average of $teps* -. 2. /. 2. 4. input input y sum 0 1 y average 0 sum 32 output average

&nput y $um 0 1y

Average 0 sum32

Output Averag e +6'

PART III: An e ercise ,roblem 2* .rite an algorithm for finding the area of a rectangle !ints* define the inputs and the outputs define the steps draw the flowchart

You might also like