Top Banner
COMPUTER PROGRAMMING Lecture 02 Prepared By Mr. V. S. Patil Dept (CSE)/AEC
22

COMPUTER PROGRAMMING UNIT 1 Lecture 2

Aug 19, 2015

Download

Engineering

Vishal Patil
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COMPUTER PROGRAMMING UNIT 1 Lecture 2

COMPUTER PROGRAMMING

Lecture 02

Prepared By Mr. V. S. Patil Dept (CSE)/AEC

Page 2: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Unit 1 Problem SolvingSyllabus

Prepared By Mr. V. S. Patil Dept (CSE)/AEC

Page 3: COMPUTER PROGRAMMING UNIT 1 Lecture 2

2

1 To understand the basics of problem solving

on computers

To solve any real life or program problem

Objectives

Page 4: COMPUTER PROGRAMMING UNIT 1 Lecture 2

• 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.

Page 5: COMPUTER PROGRAMMING UNIT 1 Lecture 2

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.

Page 6: COMPUTER PROGRAMMING UNIT 1 Lecture 2

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.

Page 7: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Problem Solving is easy if you follow these steps

Understandthe

problem

Page 8: COMPUTER PROGRAMMING UNIT 1 Lecture 2

• 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

Page 9: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 1 - Understand the ProblemRead 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?

Page 10: COMPUTER PROGRAMMING UNIT 1 Lecture 2

• 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 ProblemFind the important information.

Page 11: COMPUTER PROGRAMMING UNIT 1 Lecture 2

• 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 ProblemWrite down the numbers.

Total = 31 1st week =14

Page 12: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 1 - Understand the ProblemIdentify 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 = ?

Page 13: COMPUTER PROGRAMMING UNIT 1 Lecture 2

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 = ?

Page 14: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Problem Solving is easy if you follow these steps

Decide howyou’re going

to solve theproblem

Page 15: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 2 - Decide how you’re going to solve the problemChoose 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

Page 16: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 2 - Decide how you’re going to solve the problemWrite 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

Page 17: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Problem Solving is easy if you follow these steps

Solve The

Problem

31-14=17

Page 18: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Problem Solving is easy if you follow these steps

LookBack &Check

Page 19: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 4 - Look Back & CheckReread 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

Page 20: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 4 - Look Back & CheckSubstitute 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

Page 21: COMPUTER PROGRAMMING UNIT 1 Lecture 2

Step 4 - Look Back & CheckDid your new number work?

14+17=31 Yes

Page 22: COMPUTER PROGRAMMING UNIT 1 Lecture 2

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