Subject: Computer Science
A flowchart is a diagram showing a sequence of events that describes the activities necessary to the solution to a problem. It is drawn using a set of conventional symbols. The symbols are connected by the arrowhead that indicates the order in which activities will occur. The different types of symbols that are used in flowchart are:
Source:www.conceptdraw.com
Flowcharts have some basic features. The basic of a flowchart is its origination from where it begins.
The major two types of flowcharts are:
1. System Flowchart
System flowcharts give the direction of a program so that programs or modules are controlled. They display all the codes to be used in the main program and different modules. Such flowcharts give detail information to the programmer. This is like a processing machine. For example, information processing cycle, manufacturing industry, etc.
Source: www.slideshare.net
The above structure is a master block diagram of system flowchart. Each and every item is sub-divided into different modules and every module consists of numerous programs.
2. Program Flowchart
A flowchart which is used to process or solve a problem through a program is called program flowchart. The natures of problem differ from time to time. Use of different signs and symbols for developing different programs represent program flowchart. So, the size of a program determines flowchart.
Advantages of Flowchart
Disadvantages of Flowchart
Flowcharts can be very simple where few symbols can depict the logic. They can be complex too. There are three constructs of a flowchart. They are:
Flowchart Examples
Algorithm
Step 1: Remember or read the telephone number. Step 2: Lift the receiver Step 3: Is there a dial tone? If yes, then dial telephone, go to step 4. { If no, then put down the receiver. Go to step 2} Step 4: Speak Step 5: Put down the receiver. |
Flowchart
Algorithm
Step 1: Start Step 2: Read principle, Rate and Time Step 3: Multiply principal * Rate * Time Step 4: Divide by 100 Step 5: Write the answer Step 6: Any more calculations? { If yes, then go to step 2 If No } Step 7: Stop |
Flowchart
Algorithm
Step 1: Start Step 2: Subject = 1 Step 3: Input mark for this Subject Step 4: Add marks and store into a variable Step 5: Are all subjects (7 subjects) done? { If No, then increase the subject number and go to step 3. If yes, then go to step 6 Step 6: Print the sum Step 7: Find average (divide by 7) Step 8: Print the sum and average Step 9: Are all (10 students done)? { If No, then increase the student number and go to step 2 If yes, then go to step 9} Step 9: End |
Flowchart
A program is initiated with a declaration of data types, definition of function procedures, subprograms or sub-procedures. As soon as the program is initiated, the data types are declared in the program. After the data are defined, the data are processed in different order. The order at which the program codes are written can be classified in the following categories.
Sequence: When a program is written in linear fashion, the program is in a sequence. The program initiates at a certain level and continues till the last command or statement. Such fashion is useful when the program is small and less logical.
Control structures: The program which contains certain logic, jumps from one point to another and certain repetition possesses control structures. The control structures mostly used are:
Selections: A selection is choosing options. The program provides different options. The user can choose an option as required. The common statements used for this activity are:
These statements provide choices for menu driven programs. Although the syntax and users in the different programming language are similar, we cannot rule out the variation. Therefore, the reader will have to consult the necessary manual referred to the particular programming language for the complete idea of these selections.
Repetitions (Loops): When a program goes through a loop for certain times repeatedly, it is known as repetition. There are two types of loops. They are; finite loop and infinite loop. The infinite loop stops after executing certain program codes or repetitions.
An infinite loop never ends. The loops are constructs of programs. The first value that initiates program loop is called initial value and the last value reached in a finite loop is known as a sentinel value. When the sentinel value is obtained, the program stops looping. The different methods of creating loops are:
References:
Khanal, R.C. Khanal, R.C. Computer Concept for XII. Pashupatigriha Marga, Thapathali, Kathmandu, Nepal: Ekta Books Distributors Pvt. Ltd., 2010. 119-129.
Adhikari, Deepak Kumar.,et.al., Computer Science XII,Asia Publication Pvt.Ltd
© 2019-20 Kullabs. All Rights Reserved.