UNIT 6
FUNDAMENTALS OF PROGRAMMING
6.2 Steps in Problem Solving
# Designed a four-step method to solve all kinds of problems. Because the method is simple and generalizes well, it has become a
classic method for solving computational problems.
# The four steps of problem solving that Polya suggested are: 1. Understand the problem. 2. Make a plan. 3. Execute the plan. 4. Review
and extend.
# four stage of problem solving is adjusted into the following in computer science and information technology: 1. Understand the
problem. 2. Develop an algorithm. 3. Write the program. 4. Test the program.
6.3 Working with Flowcharts and Block Programming
# Flowcharts and pseudocodes are two such standard mechanisms used for algorithm representation. Flowcharts use special shapes to
represent different types of actions or steps in a process. Lines and arrows show the sequence of the steps, and the relationships among
them. A pseudocode is a simple and concise sequence of English-like instructions to solve a problem.
6.3.1 Developing flowcharts
# Flowcharts can be used to represent both computational and non-computational activities.
Flowchart of a school peace-building policy
6.3.2 Working with Decisions and Repetitions
Grade 10
6.2 Basics of Algorithm
Algorithm is a step-by-step process of solving a well-defined computational problem.
To solve the problem using computers, we must follow the steps described below. a. The problem must be analyzed
thoroughly. b. Solution method is broken down into a sequence of small tasks. c. Based on this analysis, an algorithm
must be prepared to solve the prob lem. d. The algorithm must be expressed in precise notation. e. In viewing algorithm, a
computer program has to be designed in any high-level language. f. The computer program is fed into the computer. g. The
instruction in the program executes one after another and outputs the expected result.
6.3 Definition of Algorithm
An algorithm is a precise method of solving a problem. It consists of a sequence of unambiguous, step-by-step
instructions. A program is an algorithm that has been converted into program code so that it can be executed by a
computer. A well-written algorithm should be free from logic errors and easy to code in any high-level language. Some of
the most widely used definitions of an algorithm are described hereunder. An algorithm is a set of rules for carrying out
calculations either by hand or a machine. An algorithm is a finite step-by-step procedure to achieve a required result. An
algorithm is a sequence of computational steps that transform the input into the output.
The term algorithm means “a process or set of rules to be followed in calcu lations or other problem-solving operations”.
Therefore, algorithm refers to a set of rules/instructions that define step-by-step how a work is to be executed to get the
expected results.