Вы находитесь на странице: 1из 22

COMPUTER

PROGRAMMING
Lecture 02
Unit 1 Problem Solving
Syllabus
Objecti
ves

2
To solve any real life or program problem
1
To understand the basics of problem solving
on computers
Basic concept of problem on computer

For solving problem on computer following steps are required. (This


steps called as Software Life Cycle. )
1) Problem Statement:-
The Problem statement should be clear and unambiguous.
If the statement is not precise and clear, the design and
implementation will be erroneous.
2) Problem Analysis and Design:-
This step is very crucial step in writing a program.
The problem should analyzed to find the most efficient way in which
it can be solve.
An algorithm to solve the problem is developed based on the
analysis.
continue..
3) Analysis of the algorithm:-
The algorithm should be analyzed to check if it is perform the
desired action using a reasonable amount of time and memory.
4) Coding:-
This step involves coding the algorithm using an appropriate
language to form a program.
The choice of a programming language depends on a several factor.
5) Documentation:-
Documentation is essential to make the program easy to
understand.
It informs the reader about the working of program.
Continue..
6) Testing:-
The program should be tested thoroughly using all the possible
type of input.
Testing detects incorrectness of program if any.
7) Maintenance:-
The program may require changes depends on its application.
The changes and updates required are perform during
maintenance.
Problem Solving is easy if you follow these
steps

Understand
the
problem
Step 1 Understand the problem

Read the problem carefully.


Find the important information.
Write down the numbers.
Identify what the problem wants you to solve.
Ask if your answer is going to be a larger or smaller
number compared to what you already know.
Step 1 - Understand the Problem
Read the problem carefully.

Luis earned 14 Accelerated Reading points the first week


of November. At the end of the following week he had a
total of 31 points. How many points did he earn the
second week?
Step 1 - Understand the Problem
Find the important information.

Luis earned 14 Accelerated Reading points the first


week of November. At the end of the following week he
had a total of 31 points.
How many points did he earn the second week?
Step 1 - Understand the Problem
Write down the numbers.

Luis earned 14 Accelerated Reading points the first week


of November. At the end of the following week he had a
total of 31 points. How many points did he earn the
second week?

Total = 31 1st week =14


Step 1 - Understand the Problem
Identify what the problem wants you to solve
Luis earned 14 Accelerated Reading points the first week of
November. At the end of the following week he had a total of
31 points. How many points did he earn the second week?

Total = 31 1st week =14

2nd week = ?
Step 1 - Understand the Problem

Ask if your answer is going to be a larger or


smaller number compared to what you already
know.
Total = 31 1st week =14

2nd week = ?

It will be smaller than the total but may or may not be smaller
than the first week.
Problem Solving is easy if you follow these
steps

Decide how
youre going
to
solve the
problem
Step 2 - Decide how youre going to solve the
problem
Choose a method
Use a graph Use formulas
Write an equation Make a list
Find a pattern Work backwards
Use reasoning Draw a picture
Make a table Act it out
Step 2 - Decide how youre going to solve the
problem
Write your equation
Total = 31 1st week =14
2nd week = ?
Since I know both weeks total 31 I write
14 + s = 31
I can use the inverse operation to solve
14 + s = 31 31 14 = s
Problem Solving is easy if you follow these
steps

Solve
The
Problem

31-14=17
Problem Solving is easy if you follow these
steps

Look
Back &
Check
Step 4 - Look Back & Check
Reread the problem
Luis earned 14 Accelerated Reading points the first week
of November. At the end of the following week he had a
total of 31 points. How many points did he earn the second
week?

Total=31 1st week=14


Step 4 - Look Back & Check
Substitute your new number
Luis earned 14 Accelerated Reading points the first week
of November. At the end of the following week he had a
total of 31 points. How many points did he earn the second
week?

Total=31 1st week=14 2nd week=17


14+17=31
Step 4 - Look Back & Check
Did your new number work?
14+17=31 Yes
Question Bank
1.Explain the steps involved in problem solving on
computer
2.Write down the steps to solve following problem.
i) Addition of two numbers.
ii) To calculate Area of circle

Вам также может понравиться