COMPUTER
PROGRAMMING
Lecture 02
Prepared By Mr. V. S. Patil Dept (CSE)/AEC
Unit 1 Problem Solving
Syllabus
Prepared By Mr. V. S. Patil Dept (CSE)/AEC
2
1
 To understand the basics of problem solving
on computers
To solve any real life or program problem
Objectives
• 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
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
• 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
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?
• 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.
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.
• It will be smaller than the total but may or may not be smaller
than the first week.
Total = 31 1st week =14
2nd week = ?
Problem Solving is easy if you follow these
steps
Decide how
you’re going
to
solve the
problem
Step 2 - Decide how you’re 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 you’re going to solve the
problem
Write your equation
• 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
Total =
31 2nd week = ?
1st week =14
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

COMPUTER PROGRAMMING UNIT 1 Lecture 2

  • 1.
    COMPUTER PROGRAMMING Lecture 02 Prepared ByMr. V. S. Patil Dept (CSE)/AEC
  • 2.
    Unit 1 ProblemSolving Syllabus Prepared By Mr. V. S. Patil Dept (CSE)/AEC
  • 3.
    2 1  To understandthe basics of problem solving on computers To solve any real life or program problem Objectives
  • 4.
    • Basic conceptof 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
  • 5.
    continue.. 3) Analysis ofthe 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.
  • 6.
    Continue.. 6) Testing:- • Theprogram 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.
  • 7.
    Problem Solving iseasy if you follow these steps Understand the problem
  • 8.
    • Read theproblem 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
  • 9.
    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?
  • 10.
    • Luis earned14 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.
  • 11.
    • Luis earned14 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. Total = 31 1st week =14
  • 12.
    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 = ?
  • 13.
    Step 1 -Understand the Problem Ask if your answer is going to be a larger or smaller number compared to what you already know. • It will be smaller than the total but may or may not be smaller than the first week. Total = 31 1st week =14 2nd week = ?
  • 14.
    Problem Solving iseasy if you follow these steps Decide how you’re going to solve the problem
  • 15.
    Step 2 -Decide how you’re 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
  • 16.
    Step 2 -Decide how you’re going to solve the problem Write your equation • 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 Total = 31 2nd week = ? 1st week =14
  • 17.
    Problem Solving iseasy if you follow these steps Solve The Problem 31-14=17
  • 18.
    Problem Solving iseasy if you follow these steps Look Back & Check
  • 19.
    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
  • 20.
    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
  • 21.
    Step 4 -Look Back & Check Did your new number work? 14+17=31 Yes
  • 22.
    Question Bank 1.Explain thesteps 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