SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Tutor: Bilal Janjooa Assistant Professor
The University of Lahore
MS Telecom. Eng. From The University of Sunderland UK
1Bilal Janjooa bilal.janjooa@yahoo.co.uk
Lecture No. 2
2Bilal Janjooa bilal.janjooa@yahoo.co.uk
Outline
 A computer is a useful tool for solving a great variety of
problems.
 To make a computer do anything (i.e. solve a problem),
we have to write a computer program.
 In a computer program we tell a computer, step by
step, exactly what want to do.
3Bilal Janjooa bilal.janjooa@yahoo.co.uk
What is program
“A precise sequence of steps to
solve a particular problem”
4Bilal Janjooa bilal.janjooa@yahoo.co.uk
 Following each step mechanically, to accomplish the
end goal.
 The sequence of steps to be performed in order to
solve a problem by the computer is known as an
algorithm.
 Flowchart is a graphical or symbolic representation of
an algorithm. It is the diagrammatic representation of
the step-by-step solution to a given problem.
5Bilal Janjooa bilal.janjooa@yahoo.co.uk
Concept of Languages
Languages are used for
Communication between Users and
Computers.
6Bilal Janjooa bilal.janjooa@yahoo.co.uk
Program Design Process
 Program Design consists of the steps a programmer
should do before they start coding the program in a
specific language. Proper program design helps other
programmers to maintain the program in the future.
7Bilal Janjooa bilal.janjooa@yahoo.co.uk
8Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Solving is easy if you
follow these steps
Understan
d
the
problem
9Bilal Janjooa bilal.janjooa@yahoo.co.uk
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. 10Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 1 - Understand the Problem
Read the problem carefully.
Ahmed earned 14 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?
11Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 1 - Understand the Problem
Find the important information.
Ahmed 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?
12Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 1 - Understand the Problem
Write down the numbers.
Ahmed 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
13Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 1 - Understand the Problem
Identify what the problem wants
you to solve.
Ahmed 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 = 14Bilal Janjooa bilal.janjooa@yahoo.co.uk
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.
15Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Solving is easy if you
follow these steps
Decide
how
you’re
going to
solve the
problem
16Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
17Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
Total = 31 1st week =14
2nd week =
?
18Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 2 - Decide how you’re going to
solve the problem
Write your equation
I can use the inverse operation to solve for s
14 + s = 31 31 – 14 = s
Total = 31 1st week =14
2nd week =
?
19Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Solving is easy if you
follow these steps
Solve
The
Problem
20Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 3 - Solve the problem
3 1
– 1 4
Total = 31 1st week =14
2nd week =
? 2
1
71 21Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Solving is easy if you
follow these steps
Look
Back &
Check
22Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
23Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
24Bilal Janjooa bilal.janjooa@yahoo.co.uk
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?
14 + 17 = 31
25Bilal Janjooa bilal.janjooa@yahoo.co.uk
Step 4 - Look Back & Check
Did your new number work?
Ahmed 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?
14 + 17 = 31 Yes!
26Bilal Janjooa bilal.janjooa@yahoo.co.uk
Program Design Phases
 Program Design Process Include:
 Problem Solving Phase
 Implementation Phase
27Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Solving Phase
 Problem solving is a skill which can be developed by
following a well organized approach.
 Programming is also a problem solving activity.
 Programmer use software development method to
solve problems.
28Bilal Janjooa bilal.janjooa@yahoo.co.uk
Software development activities
 The following steps can be followed to solve any kind
of problem:
1. Problem Identification
2. Specify Requirements
3. Analyze Problem
4. Design algorithm and draw flowchart
5. Write the program (Coding)
6. Testing and Debug the program
7. Implement the program
8. Maintain and Update the program
9. Document the program
29Bilal Janjooa bilal.janjooa@yahoo.co.uk
Problem Identification
 At this stage the problem being solved is observed
carefully.
 Major area of concern are identified.
 Irrelevant information is filter out.
30Bilal Janjooa bilal.janjooa@yahoo.co.uk
Specify Requirements
 This stage demands to make clear the user’s
requirements so that a proper solution could be
suggested.
 Requirements are documented here.
31Bilal Janjooa bilal.janjooa@yahoo.co.uk
Analyze the problem
 Problem is decomposed into sub-problems.
 This lead to simple solution
 The technique is known is top down design (also
called divide and conquer(overcome) rule ).
 To approach the right solution we may ask certain
questions:-
i. How many solutions are there to the given problem?
ii. Which one is the best solution?
iii. What are the input and output?
iv. How can the bigger problem be divided into sub
problems?
32Bilal Janjooa bilal.janjooa@yahoo.co.uk
Design Algorithm and draw
Flowchart
 Designing the algorithm requires to develop a finite
list of steps to solve a problem.
 Once algorithm has been designed it should be
verified through desk checking.
 Desk Checking is the process of carefully observing the
working of an algorithm, on the paper, for some test data.
 After designing the algorithm, the next step is to draw
a flowchart.
 Flowchart in fact, maps the algorithm to a pictorial
presentation which helps in understanding the flow of
control and data in algorithm.
33Bilal Janjooa bilal.janjooa@yahoo.co.uk
Write the Program (Coding)
 Coding involves the conversion of an algorithm to
a program, written in any programming language.
 The programmer must know the syntax of the
programming language chosen.
 The grammatical rules of a programming language
to write programs are referred to as syntax of that
programming language.
34Bilal Janjooa bilal.janjooa@yahoo.co.uk
Test and Debug the program
 Testing requires evaluating the program to verify that
it works as desired.
 Debugging is the process of finding and removing
errors in the program.
35Bilal Janjooa bilal.janjooa@yahoo.co.uk
Test and Debug the program
 There can be three types of errors:-
 Syntax Errors:-
 Occur when program violates one or more grammatical
rules of the programming language.
 Usually detected at compile time by the compiler.
 There can be many reasons such as typing wrong
commands or program statements.
36Bilal Janjooa bilal.janjooa@yahoo.co.uk
Test and Debug the program
 Logical Errors:-
 Logical errors occur when program follow a wrong logic.
 The translator (compiler or interpreter) does not report
any error message for a logical errors.
 Can be identified by just looking at the wrong output of
the program.
37Bilal Janjooa bilal.janjooa@yahoo.co.uk
Test and Debug the program
 Runtime Errors:-
 A runtime error occurs when the program directs the
computer to perform an illegal operation such as
dividing a number by zero.
 When runtime error occur, the computer will stop
executing the program and may display a diagnostic
message that helps in locating the error.
38Bilal Janjooa bilal.janjooa@yahoo.co.uk
Implement the Program
(deployment)
 Once the program has been tested thoroughly, it must
be installed or put into operation at the site where it
will be used.
39Bilal Janjooa bilal.janjooa@yahoo.co.uk
Maintain & Update the Program
 Program maintenance is ongoing process of upgrading
the program to accommodate new hardware and
software.
 Regular maintenance is essential to the continued
usefulness of a program.
40Bilal Janjooa bilal.janjooa@yahoo.co.uk
Document the program
 Documentation is a detailed description of a program’s
algorithm, design, coding method, testing and proper
usage.
 A comprehensive documentation consists of the following:
 A description of what the program is supposed to do.
 A description of the problem solution (the algorithm).
 A description of the program design including any aids used
(flowcharts, algorithms etc.).
 A description of the program’s testing process, including test data
used and result obtained.
 A description of all correctness modification and updates made to
the program.
 A user manual (user guide).
41Bilal Janjooa bilal.janjooa@yahoo.co.uk
Thank You
42Bilal Janjooa bilal.janjooa@yahoo.co.uk

Weitere ähnliche Inhalte

Ähnlich wie Programming fundamentals 2

Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
ALI RAZA
 
How do programmers solve problems
How do programmers solve problemsHow do programmers solve problems
How do programmers solve problems
camfollower
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
Raja Hamid
 
Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
alvin567
 

Ähnlich wie Programming fundamentals 2 (17)

Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsxCC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept2.1 Understand problem solving concept
2.1 Understand problem solving concept
 
How do programmers solve problems
How do programmers solve problemsHow do programmers solve problems
How do programmers solve problems
 
Variables lesson tasks
Variables lesson tasksVariables lesson tasks
Variables lesson tasks
 
Oct 20 Observation
Oct 20 ObservationOct 20 Observation
Oct 20 Observation
 
Prog Design
Prog DesignProg Design
Prog Design
 
Product manager interview estimation
Product manager interview estimationProduct manager interview estimation
Product manager interview estimation
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 
Learning area 5 programming
Learning area 5   programmingLearning area 5   programming
Learning area 5 programming
 
Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
Linear programming
Linear programmingLinear programming
Linear programming
 
SPL 2 | Algorithms, Pseudo-code, and Flowchart
SPL 2 | Algorithms, Pseudo-code, and FlowchartSPL 2 | Algorithms, Pseudo-code, and Flowchart
SPL 2 | Algorithms, Pseudo-code, and Flowchart
 
8 Steps Problem Solving Method -2.pdf
8 Steps Problem Solving Method -2.pdf8 Steps Problem Solving Method -2.pdf
8 Steps Problem Solving Method -2.pdf
 
8 step Problem solving Method.pdf
8 step Problem solving Method.pdf8 step Problem solving Method.pdf
8 step Problem solving Method.pdf
 
computational_thinking_gcse.pptx
computational_thinking_gcse.pptxcomputational_thinking_gcse.pptx
computational_thinking_gcse.pptx
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Programming fundamentals 2

  • 1. Tutor: Bilal Janjooa Assistant Professor The University of Lahore MS Telecom. Eng. From The University of Sunderland UK 1Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 2. Lecture No. 2 2Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 3. Outline  A computer is a useful tool for solving a great variety of problems.  To make a computer do anything (i.e. solve a problem), we have to write a computer program.  In a computer program we tell a computer, step by step, exactly what want to do. 3Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 4. What is program “A precise sequence of steps to solve a particular problem” 4Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 5.  Following each step mechanically, to accomplish the end goal.  The sequence of steps to be performed in order to solve a problem by the computer is known as an algorithm.  Flowchart is a graphical or symbolic representation of an algorithm. It is the diagrammatic representation of the step-by-step solution to a given problem. 5Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 6. Concept of Languages Languages are used for Communication between Users and Computers. 6Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 7. Program Design Process  Program Design consists of the steps a programmer should do before they start coding the program in a specific language. Proper program design helps other programmers to maintain the program in the future. 7Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 9. Problem Solving is easy if you follow these steps Understan d the problem 9Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 10. 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. 10Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 11. Step 1 - Understand the Problem Read the problem carefully. Ahmed earned 14 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? 11Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 12. Step 1 - Understand the Problem Find the important information. Ahmed 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? 12Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 13. Step 1 - Understand the Problem Write down the numbers. Ahmed 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 13Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 14. Step 1 - Understand the Problem Identify what the problem wants you to solve. Ahmed 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 = 14Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 15. 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. 15Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 16. Problem Solving is easy if you follow these steps Decide how you’re going to solve the problem 16Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 17. 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 17Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 18. 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 Total = 31 1st week =14 2nd week = ? 18Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 19. Step 2 - Decide how you’re going to solve the problem Write your equation I can use the inverse operation to solve for s 14 + s = 31 31 – 14 = s Total = 31 1st week =14 2nd week = ? 19Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 20. Problem Solving is easy if you follow these steps Solve The Problem 20Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 21. Step 3 - Solve the problem 3 1 – 1 4 Total = 31 1st week =14 2nd week = ? 2 1 71 21Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 22. Problem Solving is easy if you follow these steps Look Back & Check 22Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 23. 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 23Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 24. 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 24Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 25. 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? 14 + 17 = 31 25Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 26. Step 4 - Look Back & Check Did your new number work? Ahmed 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? 14 + 17 = 31 Yes! 26Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 27. Program Design Phases  Program Design Process Include:  Problem Solving Phase  Implementation Phase 27Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 28. Problem Solving Phase  Problem solving is a skill which can be developed by following a well organized approach.  Programming is also a problem solving activity.  Programmer use software development method to solve problems. 28Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 29. Software development activities  The following steps can be followed to solve any kind of problem: 1. Problem Identification 2. Specify Requirements 3. Analyze Problem 4. Design algorithm and draw flowchart 5. Write the program (Coding) 6. Testing and Debug the program 7. Implement the program 8. Maintain and Update the program 9. Document the program 29Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 30. Problem Identification  At this stage the problem being solved is observed carefully.  Major area of concern are identified.  Irrelevant information is filter out. 30Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 31. Specify Requirements  This stage demands to make clear the user’s requirements so that a proper solution could be suggested.  Requirements are documented here. 31Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 32. Analyze the problem  Problem is decomposed into sub-problems.  This lead to simple solution  The technique is known is top down design (also called divide and conquer(overcome) rule ).  To approach the right solution we may ask certain questions:- i. How many solutions are there to the given problem? ii. Which one is the best solution? iii. What are the input and output? iv. How can the bigger problem be divided into sub problems? 32Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 33. Design Algorithm and draw Flowchart  Designing the algorithm requires to develop a finite list of steps to solve a problem.  Once algorithm has been designed it should be verified through desk checking.  Desk Checking is the process of carefully observing the working of an algorithm, on the paper, for some test data.  After designing the algorithm, the next step is to draw a flowchart.  Flowchart in fact, maps the algorithm to a pictorial presentation which helps in understanding the flow of control and data in algorithm. 33Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 34. Write the Program (Coding)  Coding involves the conversion of an algorithm to a program, written in any programming language.  The programmer must know the syntax of the programming language chosen.  The grammatical rules of a programming language to write programs are referred to as syntax of that programming language. 34Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 35. Test and Debug the program  Testing requires evaluating the program to verify that it works as desired.  Debugging is the process of finding and removing errors in the program. 35Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 36. Test and Debug the program  There can be three types of errors:-  Syntax Errors:-  Occur when program violates one or more grammatical rules of the programming language.  Usually detected at compile time by the compiler.  There can be many reasons such as typing wrong commands or program statements. 36Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 37. Test and Debug the program  Logical Errors:-  Logical errors occur when program follow a wrong logic.  The translator (compiler or interpreter) does not report any error message for a logical errors.  Can be identified by just looking at the wrong output of the program. 37Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 38. Test and Debug the program  Runtime Errors:-  A runtime error occurs when the program directs the computer to perform an illegal operation such as dividing a number by zero.  When runtime error occur, the computer will stop executing the program and may display a diagnostic message that helps in locating the error. 38Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 39. Implement the Program (deployment)  Once the program has been tested thoroughly, it must be installed or put into operation at the site where it will be used. 39Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 40. Maintain & Update the Program  Program maintenance is ongoing process of upgrading the program to accommodate new hardware and software.  Regular maintenance is essential to the continued usefulness of a program. 40Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 41. Document the program  Documentation is a detailed description of a program’s algorithm, design, coding method, testing and proper usage.  A comprehensive documentation consists of the following:  A description of what the program is supposed to do.  A description of the problem solution (the algorithm).  A description of the program design including any aids used (flowcharts, algorithms etc.).  A description of the program’s testing process, including test data used and result obtained.  A description of all correctness modification and updates made to the program.  A user manual (user guide). 41Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 42. Thank You 42Bilal Janjooa bilal.janjooa@yahoo.co.uk