An algorithm is a sequence of steps designed to perform a particular task. A computer is not intelligent enough to do things by itself; it is only capable of carrying out your instructions. In order to carry out some task, a computer needs to be provided a program, which is an implementation of an algorithm. Developing a correct algorithm is an intellectual challenge while coding is straightforward. An algorithm is a representation of a solution to a problem.
The most widely used notations for developing algorithms are:
Its algorithm will have the following steps:
Pseudocode is as follows:
Algorithm student's final grade
Step 1. Scan four values which are M1, M2, M3, M4
Step 2. GRADE = (M1 + M2 + M3 + M4) / 4
Step 3. if (GRADE < 40)
Print “FAIL”
else
Print “PASS”
Step 4: Exit
A flowchart is a graphical representation of the sequence of operations in a program. It is a tool developed to show the steps involved in a process. Program flowcharts show the sequence of instructions in a single program. It shows the logic of an algorithm. It emphasizes individual steps and their interconnections.
The chart helps us to solve any problem easily through pictures compared to words. Hence an algorithm can be represented diagrammatically in the form of a flowchart.
A flowchart is basically the plan to be followed when the program is written. It acts as a road map for a programmer and guides him in proceeding from the starting point to the final point while writing a computer program. For a beginner, it is strongly recommended that a flowchart is drawn first in order to reduce the number of errors and omissions in the program. Moreover, it is a good practice to have a flowchart along with a computer program as it is helpful in testing the program and also in incorporating any modifications.
A flowchart uses boxes of different shapes to denote different types of instructions. The actual instructions are written within these boxes through clear and concise statements. Different flow chart symbols have different meanings. The most common flow chart symbols are shown in the following table.
Common flowchart symbols
A set of flowcharting rules are as follows
A flowchart has the following limitations:
Pseudocode is one of the tools that can be used to write a basic plan which can be developed into a computer program. It can be called a template used to write detailed codes in a specific programming language. Pseudocode is a way in which an algorithm without the use of any specific programming language syntax is described. It is, as the name pseudo-code suggests, cannot be executed on a real computer, but it models and resembles real programming code, which in turn is helpful in formulating the actual algorithm. Pseudocode, by nature, exists in various forms, although most borrow syntax from other programming languages (like Lisp, C, or FORTRAN).
This technique resultsPseudocode is one of the tools that can be used to write a basic plan which can be developed into a computer program. It can be called a template used to write detailed codes in a specific programming language. Pseudocode is a way in which an algorithm without the use of any specific programming language syntax is described. It is, as the name pseudo-code suggests, cannot be executed on a real computer, but it models and resembles real programming code, which in turn is helpful in formulating the actual algorithm. Pseudocode, by nature, exists in various forms, although most borrow syntax from other programming languages (like Lisp, C, or FORTRAN).
This technique results in a series of numbered steps that are executed in sequence. Each step is written using a subset of a language you can understand (in my case, English). This subset is based on a common set of verbs found in procedural programming languages and the common mathematical operators (+, -, *, /, =).
7 videos|27 docs|69 tests
|
|
Explore Courses for Class 9 exam
|