SlideShare une entreprise Scribd logo
1  sur  48
Lecture 1

Introduction to Programming

   Tariq Ali, Room No 21
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.
What is program
     “A precise sequence of steps to
       solve a particular problem”
 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.
Concept of Languages


 Languages are used for
 Communication between Users and
 Computers.
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.
Problem Solving
Problem Solving is easy if you follow
these steps



              Understan
                  d
                 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
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
                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



 Total = 31        1st week =14
           2nd week =
Since I know both weeks total 31 I
           ?
               write
           14 + s = 31
Step 2 - Decide how you’re going to
 solve the problem
 Write your equation



  Total = 31        1st week =14
           2nd week =
I can use the inverse operation to
           ?
            solve for s
   14 + s = 31     31 – 14 = s
Problem Solving is easy if you follow
these steps



                Solve
                 The
               Problem
Step 3 - Solve the problem

Total = 31    1st week =14
        2nd week =
        ? 312
            1
         –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= 31
  Total   week?
             1st week =14
        2nd week = 17
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
Step 4 - Look Back & Check
Did your new number work?
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 Yes!
Write an equation to solve this
  problem.

Jaylynn had $84.75 in her
 savings account. She made a
 deposit. Her new balance was
 $107.03. How much was her
 deposit?
      $84.75 + d = $107.03
        Inverse operation
      $107.03 – $84.75 = d
Write an equation to solve this
  problem.

Anthony has twice as many
 pokemon cards as Joshua. If
 Anthony has 124 cards, how
 many does Joshua have?
     2 x d = 124    2d = 124
  inverse operation d = 124/2
Write an equation to solve this
  problem.

Vicki baked 90 cookies . If there
 are 15 cookies in each batch.
 How many batches did she
 bake?
     15 x b = 90      15b =90
  inverse operation b = 90/15
Write an equation to solve this
  problem.

Navneet has 3 times as many
 CD’s as Arlene. If Navneet has
 36 CD’s, how many does Arlene
 have?
     3 x c = 36      3c =
   inverse operation c = 36/3
     36
Write an equation to solve this
  problem.

A square has a perimeter of 48
 inches. What is the length of
 each side of the square.
      4 x s = 48         4s =
      48 operation s = 48/4
   inverse
Write an equation to solve this
  problem.

One year the city ambulance
 responded to emergencies on
 293 days. How many days were
 there no emergencies?
           293 + d = 365
inverse operation d = 365 - 293
Credits

 Clipart from Broderbund ClickArt 125,000
 Deluxe Image Pak

 Clipart from Corel Gallery by Corel Corp.
Program Design Phases


     Program Design Process Include:
              Problem Solving Phase
              Implementation Phase
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.
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
Problem Identification
 At   this stage the problem being solved is
  observed carefully.
 Major area of concern are identified.
 Irrelevant information is filter out.
Specify Requirements
 This stage demands to make clear the user’s
  requirements so that a proper solution could be
  suggested.
 Requirements are documented here.
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 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?
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.
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.
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.
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.
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.
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.
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.
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.
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).
l

Contenu connexe

Tendances

Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSURBHI SAROHA
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codehamza javed
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive ProgrammingGaurav Agarwal
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 
Computer Language Translator
Computer Language TranslatorComputer Language Translator
Computer Language TranslatorRanjeet Kumar
 
Introduction to Python - Training for Kids
Introduction to Python - Training for KidsIntroduction to Python - Training for Kids
Introduction to Python - Training for KidsAimee Maree Forsstrom
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 
Programming languages
Programming languagesProgramming languages
Programming languagesvito_carleone
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm designNahid Hasan
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
Session 3 : Competitive programming 1
Session 3 : Competitive programming 1Session 3 : Competitive programming 1
Session 3 : Competitive programming 1Koderunners
 
Complexity Analysis
Complexity Analysis Complexity Analysis
Complexity Analysis Shaista Qadir
 
Flowcharts and pseudocodes
Flowcharts and pseudocodesFlowcharts and pseudocodes
Flowcharts and pseudocodesDr Piyush Charan
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 

Tendances (20)

Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive Programming
 
The Knowledge of QBasic
The Knowledge of QBasicThe Knowledge of QBasic
The Knowledge of QBasic
 
computer languages
computer languagescomputer languages
computer languages
 
Computer Language Translator
Computer Language TranslatorComputer Language Translator
Computer Language Translator
 
Introduction to Python - Training for Kids
Introduction to Python - Training for KidsIntroduction to Python - Training for Kids
Introduction to Python - Training for Kids
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Session 3 : Competitive programming 1
Session 3 : Competitive programming 1Session 3 : Competitive programming 1
Session 3 : Competitive programming 1
 
Complexity Analysis
Complexity Analysis Complexity Analysis
Complexity Analysis
 
Algorithms KS1 & KS2
Algorithms KS1 & KS2Algorithms KS1 & KS2
Algorithms KS1 & KS2
 
Flowcharts and pseudocodes
Flowcharts and pseudocodesFlowcharts and pseudocodes
Flowcharts and pseudocodes
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 

En vedette

Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming FundamentalsShahriar Hyder
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)jakejakejake2
 
Fundamental Programming Lect 4
Fundamental Programming Lect 4Fundamental Programming Lect 4
Fundamental Programming Lect 4Namrah Erum
 
Fundamental Programming Lect 5
Fundamental Programming Lect 5Fundamental Programming Lect 5
Fundamental Programming Lect 5Namrah Erum
 
Programming fundamentals lecture 3
Programming fundamentals lecture 3Programming fundamentals lecture 3
Programming fundamentals lecture 3Raja Hamid
 
Chapter 1: Intro to Funds of Programming
Chapter 1: Intro to Funds of ProgrammingChapter 1: Intro to Funds of Programming
Chapter 1: Intro to Funds of Programmingricsanmae
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to PseudocodeDamian T. Gordon
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming LanguageAhmad Idrees
 

En vedette (13)

Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming Fundamentals
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
 
Fundamental Programming Lect 4
Fundamental Programming Lect 4Fundamental Programming Lect 4
Fundamental Programming Lect 4
 
Fundamental Programming Lect 5
Fundamental Programming Lect 5Fundamental Programming Lect 5
Fundamental Programming Lect 5
 
Programming fundamentals lecture 3
Programming fundamentals lecture 3Programming fundamentals lecture 3
Programming fundamentals lecture 3
 
Chapter 1: Intro to Funds of Programming
Chapter 1: Intro to Funds of ProgrammingChapter 1: Intro to Funds of Programming
Chapter 1: Intro to Funds of Programming
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Intro to C++ - language
Intro to C++ - languageIntro to C++ - language
Intro to C++ - language
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 

Similaire à Programming fundamentals lecture 1 0f c

Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingALI RAZA
 
COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2Vishal Patil
 
Programming fundamentals 2
Programming fundamentals 2Programming fundamentals 2
Programming fundamentals 2Adeem Mirza
 
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)EA Clavel
 
computational_thinking_gcse.pptx
computational_thinking_gcse.pptxcomputational_thinking_gcse.pptx
computational_thinking_gcse.pptxbirulangit23
 
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdf
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdfGenmath11_Q1_Mod1_IntroToFunctions_Version 3.pdf
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdfCarlJustineParinas1
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithmsAlgorithms and how to write an algorithms
Algorithms and how to write an algorithmsAhmed Nobi
 
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Mansi Tyagi
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++ALI RAZA
 
Solving Equations by Factoring KTIP lesson plan
Solving Equations by Factoring KTIP lesson planSolving Equations by Factoring KTIP lesson plan
Solving Equations by Factoring KTIP lesson planJosephine Neff
 
Consolidation-Camp-Math-Lesson-2.pptx
Consolidation-Camp-Math-Lesson-2.pptxConsolidation-Camp-Math-Lesson-2.pptx
Consolidation-Camp-Math-Lesson-2.pptxLiezlAclan2
 
Problem solving technique , strategies
Problem solving technique , strategiesProblem solving technique , strategies
Problem solving technique , strategiesHussein Kareem
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingNuzhat Memon
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 

Similaire à Programming fundamentals lecture 1 0f c (20)

Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2
 
Problem Solving I.ppt
Problem Solving I.pptProblem Solving I.ppt
Problem Solving I.ppt
 
Programming fundamentals 2
Programming fundamentals 2Programming fundamentals 2
Programming fundamentals 2
 
Prog Design
Prog DesignProg Design
Prog Design
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsxCC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
 
Ch2.ppt
Ch2.pptCh2.ppt
Ch2.ppt
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
 
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)
M1S1U1 (ADDITION, SUBTRACTION AND WORD PROBLEMS)
 
computational_thinking_gcse.pptx
computational_thinking_gcse.pptxcomputational_thinking_gcse.pptx
computational_thinking_gcse.pptx
 
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdf
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdfGenmath11_Q1_Mod1_IntroToFunctions_Version 3.pdf
Genmath11_Q1_Mod1_IntroToFunctions_Version 3.pdf
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithmsAlgorithms and how to write an algorithms
Algorithms and how to write an algorithms
 
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
 
Solving Equations by Factoring KTIP lesson plan
Solving Equations by Factoring KTIP lesson planSolving Equations by Factoring KTIP lesson plan
Solving Equations by Factoring KTIP lesson plan
 
Practical 01 (detailed)
Practical 01 (detailed)Practical 01 (detailed)
Practical 01 (detailed)
 
Consolidation-Camp-Math-Lesson-2.pptx
Consolidation-Camp-Math-Lesson-2.pptxConsolidation-Camp-Math-Lesson-2.pptx
Consolidation-Camp-Math-Lesson-2.pptx
 
Problem solving technique , strategies
Problem solving technique , strategiesProblem solving technique , strategies
Problem solving technique , strategies
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 

Programming fundamentals lecture 1 0f c

  • 1. Lecture 1 Introduction to Programming Tariq Ali, Room No 21
  • 2. 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.
  • 3. What is program “A precise sequence of steps to solve a particular problem”
  • 4.  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.
  • 5. Concept of Languages  Languages are used for Communication between Users and Computers.
  • 6. 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.
  • 8. Problem Solving is easy if you follow these steps Understan d the problem
  • 9. 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
  • 10. 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?
  • 11. 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?
  • 12. 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
  • 13. 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 =
  • 14. 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.
  • 15. Problem Solving is easy if you follow these steps Decide how you’re going to solve the problem
  • 16. 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
  • 17. Step 2 - Decide how you’re 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
  • 18. Step 2 - Decide how you’re going to solve the problem Write your equation Total = 31 1st week =14 2nd week = I can use the inverse operation to ? solve for s 14 + s = 31 31 – 14 = s
  • 19. Problem Solving is easy if you follow these steps Solve The Problem
  • 20. Step 3 - Solve the problem Total = 31 1st week =14 2nd week = ? 312 1 –14 17
  • 21. Problem Solving is easy if you follow these steps Look Back & Check
  • 22. 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
  • 23. 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= 31 Total week? 1st week =14 2nd week = 17
  • 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? 14 + 17 = 31
  • 25. Step 4 - Look Back & Check Did your new number work? 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 Yes!
  • 26. Write an equation to solve this problem. Jaylynn had $84.75 in her savings account. She made a deposit. Her new balance was $107.03. How much was her deposit? $84.75 + d = $107.03 Inverse operation $107.03 – $84.75 = d
  • 27. Write an equation to solve this problem. Anthony has twice as many pokemon cards as Joshua. If Anthony has 124 cards, how many does Joshua have? 2 x d = 124 2d = 124 inverse operation d = 124/2
  • 28. Write an equation to solve this problem. Vicki baked 90 cookies . If there are 15 cookies in each batch. How many batches did she bake? 15 x b = 90 15b =90 inverse operation b = 90/15
  • 29. Write an equation to solve this problem. Navneet has 3 times as many CD’s as Arlene. If Navneet has 36 CD’s, how many does Arlene have? 3 x c = 36 3c = inverse operation c = 36/3 36
  • 30. Write an equation to solve this problem. A square has a perimeter of 48 inches. What is the length of each side of the square. 4 x s = 48 4s = 48 operation s = 48/4 inverse
  • 31. Write an equation to solve this problem. One year the city ambulance responded to emergencies on 293 days. How many days were there no emergencies? 293 + d = 365 inverse operation d = 365 - 293
  • 32. Credits  Clipart from Broderbund ClickArt 125,000 Deluxe Image Pak  Clipart from Corel Gallery by Corel Corp.
  • 33. Program Design Phases  Program Design Process Include:  Problem Solving Phase  Implementation Phase
  • 34. 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.
  • 35. 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
  • 36. Problem Identification  At this stage the problem being solved is observed carefully.  Major area of concern are identified.  Irrelevant information is filter out.
  • 37. Specify Requirements  This stage demands to make clear the user’s requirements so that a proper solution could be suggested.  Requirements are documented here.
  • 38. 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 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?
  • 39. 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.
  • 40. 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.
  • 41. 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.
  • 42. 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.
  • 43. 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.
  • 44. 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.
  • 45. 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.
  • 46. 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.
  • 47. 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).
  • 48. l