Program Design



index
Disabled back button Next Section
printable version

Section 1: Introduction

*Adapted from Introduction to Pascal and Structured Design by Dale and Orshalik

In order to write a sequence of instructions for a computer to follow, we must go through a certain process. This process is composed of a problem-solving phase and an implementation phase.

PROBLEM-SOLVING PHASE

Analyze – Understand (define) the problem.

General Solution (Algorithm) – Develop a logical sequence of steps to be used to solve the problem.

Test – Follow the exact steps as outlined to see if the solution solves the problem.

IMPLEMENTATION PHASE

Specific Solution (Program) – Translate the algorithm into a programming language (code).

Test – Have the computer follow the instructions. Check the results and make corrections until the answers are correct.

Use – Use the program.

The programmer must arrive at the solution and communicate it to the computer. The problem solving is done by the programmer – not the computer.

Section 2: Algorithms

The programmer analyzes the problem and develops a general solution called an algorithm. Understanding and analysis of a problem require a great deal of time. They are the heart of the programming processes.

Algorithm – a step-by-step procedure for solving a problem in a finite amount of time.

This topic will be covered in more detail later

Section 3: Testing

After developing a general solution, the programmer then "walks through" the algorithm by performing each step mentally or manually.

Translating the algorithm into a programming language is called coding the algorithm.

All programs are algorithms. An algorithm can be in English, but when it is specified in a programming language it is also called a program.

Some students try to take a shortcut in the programming process by going directly from the problem definition to the coding of the program.

Program documentation and maintenance are also part of programming.

Programming involves more than simply writing a program.

Section 4: Summary

Before writing a computer program to solve a problem, you go through the problem-solving phase and come up with a general solution (algorithm).