Step wise refinement.

We created a very simple design for a program that allowed the user to add two numbers together. We discussed at length the need for clear and concise steps. These allow the programmer and other to plan the flow of the program.

Add 2 numbers             Mr. Stratton

  1. Get 2 numbers
  2. Add the two numbers
  3. Display the answer

Refine Step 1

1.1     Ask for first number

1.2     Store First Number

1.3     Ask for second number

1.4     Store Second Number

Refine Step 2.

2.1 Set total = First Number + Second Number

Refine Step 3.

3.1     Display the sum

3.2     Display total