# Introduction To Problem Solving

A series of defined activities/steps that should lead to solving a problem, these activities include:

A problem Definition –a statement (a paragraph or series of paragraphs) outlining the nature of the problem

Proposition and evaluation of solution –the creation of one or more algorithms (pseudocodeor flowcharts); truth tables

Determination of most efficient solution –comparison of algorithms to test for numbers of steps, no of variables dry , runs, etc

Develop and represent algorithm–using a programming language ( PASCAL )

Test and validate solution –debugging

Problem Definition

–a statement (a paragraph or series of paragraphs) outlining the nature of the problem

E.g. of some problem definitions:

1.Write an algorithm to find the average of three numbers

2.Find the aggregate of the marks earned by a student in his Easter Terminal Examination

3.To enter a them park children under 12 pay $300.00, children over 12 and adults pay$700.00 and babies 2 years and under pay nothing. Input the number of persons entering the park. Read whether a person entering the park is an adult, child or baby and calculate the total revenue earned by the park for that day.

Proposition and evaluation of the solution

–the creation of one or more algorithms (pseudocodeor flowcharts); truth tables

E.g. of simple narrative

1.Get students mark for the following subjects –Math, English, IT

2.Add the marks of each subject and divide the sum by three (3)

3.State the result

Now you try!

–Try to write the steps involved in solving the following problems:

1.Find the aggregate of the marks earned by a student in his Easter Terminal Examination

2.To enter a them park children under 12 pay $300.00, children over 12 and adults pay $700.00 and babies 2 years and under pay nothing. Input the number of persons entering the park. Read whether a person entering the park is an adult, child or baby and calculate the total revenue earned by the park for that day.

3.VAT of 15% is added to the prices of an item. Input the name of an item and the price. Print the name of the item, the amount of VAT and the new price after VAT is added.

4.Input the name of a horse, the position it came in a race and the prize money received. The trainer is paid 5% of the prize money. Print the name of the horse, the position it came, the prize money and the amount paid to the trainer.

IPOS chart

Every problem can be divided into four distinct components:

Input–the data to be received and is necessary to arrive at the correct output.

Output–the information or data to be produced

Processing–steps that change input into output or some intermediary value

Storage–variables and constants

So how do we break down a problem?

Here is one problem:

Write an algorithm to calculate the average of three numbers.

So:

What is/are the input(s)?

What is/are the output(s)?

What are the processing steps (how do we make output from input)?

How do we store the values?

So how do we break down a problem?

DID YOU SELL…. SORRY. I MEAN… DID YOU GET IT?

INPUTS–the three numbers

OUTPUT–the average

PROCESSING–add all three numbers together and divide the sum by three

STORAGE–VARIABLES (names given to each number)

Three numbers –number1, number2, number3

The Sum of the three numbers –SUM

The average -AVERAGE

Now you try!

–DIVIDE THE FOLLOWING PROBLEMS INTO INPUT, OUTPUT PROCESSING

1.Find the aggregate of the marks earned by a student in his Easter Terminal Examination

2.To enter a them park children under 12 pay $300.00, children over 12 and adults pay $700.00 and babies 2 years and under pay nothing. Input the number of persons entering the park. Read whether a person entering the park is an adult, child or baby and calculate the total revenue earned by the park for that day.

3.VAT of 15% is added to the prices of...

Please join StudyMode to read the full document