Problem Solving, Abstraction, and Stepwise Refinement - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Problem Solving, Abstraction, and Stepwise Refinement

Description:

Debug the program using a debugger. 7. Document the Program ... Stepwise refinement is the process of gradually adding detail to a general ... – PowerPoint PPT presentation

Number of Views:384
Avg rating:5.0/5.0
Slides: 10
Provided by: AndrewSt7
Category:

less

Transcript and Presenter's Notes

Title: Problem Solving, Abstraction, and Stepwise Refinement


1
Problem Solving, Abstraction, and Stepwise
Refinement
CS240-Intermediate Programming
Created by Andrew StaugaardModified by Prof.
Martins
  • Chaminade University of Honolulu
  • Department of Computer Science

2
The Programmers Algorithm
  • Define the problem.Plan the problem
    solution.Code the program.Test and debug the
    program.Document the program.

3
Define the Problem
  • The 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
Plan the Solution
  • When planning computer programs, algorithms are
    used to outline the solution steps using English
    like statements, called pseudocode. A good
    pseudocode algorithm should be independent of,
    but easily translated into, any formal procedural
    programming language.

5
Code the Program
  • Coding 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
Debug the Program
  • Realize 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
Document the Program
  • The final program documentation is simply the
    recorded result of the problem definition,
    solution planning, coding, testing results,
    debugging results, and user instructions.

8
Problem Abstraction
  • Abstraction 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
Stepwise Refinement
  • Stepwise refinement is the process of gradually
    adding detail to a general problem solution until
    it can be easily coded in a computer language.
Write a Comment
User Comments (0)
About PowerShow.com