1 / 9

Chapter 2 Problem Solving, Abstraction, and Stepwise Refinement

Chapter 2 Problem Solving, Abstraction, and Stepwise Refinement. Chapter 2. The Programmer’s Algorithm Define the problem. Plan the problem solution. Code the program. Test and debug the program. Document the program. . Chapter 2.

wpelayo
Télécharger la présentation

Chapter 2 Problem Solving, Abstraction, and Stepwise Refinement

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2Problem Solving, Abstraction, and Stepwise Refinement

  2. Chapter 2 • The Programmer’s AlgorithmDefine the problem.Plan the problem solution.Code the program.Test and debug the program.Document the program.

  3. Chapter 2 • Define the ProblemThe problem must defined in terms of output, input, and processing. Look for nouns in the problem statement that suggest output and input. Look for verbs to suggest processing steps.

  4. Chapter 2 • Plan the SolutionWhen planning computer programs, algorithms are used to outline the solution steps using Englishlike statements, called pseudocode. A good pseudocode algorithm should be independent of, but easily translated into, any formal procedural programming language.

  5. Chapter 2 • Code the ProgramCoding involves the actual writing of the program in a formal programming language. Once a language is chosen, the program is written, or coded, by translating your algorithm steps into the formal language code.

  6. Chapter 2 • Debug the ProgramRealize that you have an error.Locate and determine the cause of the error.Fix the error. • Desk-check the program, • Compile the program. • Run the program. • Debug the program using a debugger.

  7. Chapter 2 • Document the ProgramThe final program documentation is simply the recorded result of the problem definition, solution planning, coding, testing results, debugging results, and user instructions.

  8. Chapter 2 • Problem AbstractionAbstraction provides for generalization in problem solving by allowing you to view a problem in general terms, without worrying about the details of the problem solution.

  9. Chapter 2 • Stepwise RefinementStepwiserefinement is the process of gradually adding detail to a general problem solution until it can be easily coded in a computer language.

More Related