1.08 Hand-in: Organizing problems

Tools for organizing problems

  1. Problem analysis chart
  2. Interactivity or structure chart
  3. IPO chart
  4. Algorithms
  5. Flowcharts
  6. Internal and External Documentation

1. Problem analysis chart

Contains four parts: given data, required results, processing, and list of solution alternatives. It comes in the form of a chart:

Problem analysis chart
Given data Required Results
... ...
Processing List of solution alternatives
...
  • ...
  • ...
  • ...

For example

Calculate the area of a circle for any given radius
Given data Required Results
pi
radius
Area of the circle
Processing List of solution alternatives
Area = pi * radius * radius
  • Set both radius and pi in program
  • Get both radius and pi from user
  • Set pi and get radius
  • Set radius and get pi

2. Interactivity or structure chart

This organizes the problem into sub-tasks. It often looks like an organizational chart or web diagram.

For example

3. IPO chart

IPO stands for Input/Processing/Output. It contains 4 columns: input, processing, module reference, and output. It looks like a chart.

IPO chart
Input Processing Module references Output
All known data from PAC (problem analysis chart) All processes that are required Module number where it takes place Result

For example

IPO chart
Input Processing Module references Output
radius
pi
Enter Radius
Get pi value & calculate area
Display Area
1000
2000
3000
area

4. Algorithms

An algorithm is a set of step-by-step instructions. It is sometimes called Pseudocode. It is the key component to solving any problem. You cannot assume anything, cannot skip steps, it must be executable one step at a time, and it must be complete.

Typical algorithm structure

Control module (name of module)

  1. instruction
  2. instruction
  3. instruction
  4. ...
  5. ...
  6. exit

Example algorithm

Area of circle control module (0000)

  1. Process read
  2. Process calculate
  3. Process display
  4. exit

Read module (1000)

  1. Read radius
  2. exit

Calculate module (2000)

  1. area = pi * radius * radius
  2. exit

Display module (3000)

  1. Print area
  2. exit

5. Flowchart

Programmers use algorithms to create flowcharts. Flowcharts are graphic representations of the algorithms. Flowcharts have symbols to represent parts of the program. Often flowcharts will show errors that may not been seen easily in other organizing charts.

f

Example Flowcharts

6. Internal and external documentation

Internal documentation — are notes written inside the program for other programmers to read. It lets them know what parts of the program are doing.

External documentation — usually consists of the user manuals for your program so the end user can fully understand how to install and use your program.

Saving your work

Download the assignment template for you to fill in. Rename the document using your last name in your Computer Programming 12 directory.

The assignment

The problem: Use the 5 problem solving organizational tools to outline a solution to the following problem:

Calculate the weekly gross pay for an employee based on their hourly pay rate, hours worked, and number of overtime hours.

From the Government of Nova Scotia Employment Rights website:

The general rule for overtime is that employees are entitled to receive 1 1/2 times their regular wage for each hour worked after 48 in a week. A week is defined as a consistent seven day period, e.g., Monday to Sunday, Wednesday to Tuesday. For example, if an employee makes $14.00 per hour, that employee would make $21.00 per hour for every hour worked over 48 hours.

Suggestions

Use draw.io and create your charts

When you are done, hand in all three files (html and both chart images) into the I:/ PassIn folder.

Evaluation