Jamaica Gleaner

Problem-solving and program design

- Natalee A. Johnson Urquhart CONTRIBUTO­R

GOOD DAY, students. This is lesson 18 in our series. In this week’s lesson, we will begin a new unit: Problem-solving and program design.

Previous knowledge: You are learning about this concept for the first time, but you should be familiar with solving basic everyday problems.

Betty Williams says, “There’s no use talking about the problem unless you talk about the solution.”

WHAT DOES PROBLEM-SOLVING INVOLVE?

The business dictionary defines problem-solving as the process of working through details of a problem to reach a solution. Problem-solving may include mathematic­al or systematic operations and can be a measure of an individual’s critical-thinking skills.

In our everyday life, we actually solve simple problems. For example, you have a problem meeting your deadlines.

HOW WOULD YOU SOLVE THIS PROBLEM?

1. First you need to examine the problem– determine why you are having difficulty meeting your deadlines.

2. Determine possible solutions to the problem, such as using reminders for the deadlines you have to meet on your phone, workbook, etc; getting your parents involved in reminding you about your deadlines; completing the tasks you have to complete as soon as you get them, etc.

3. The possible solutions you would then evaluate to determine the best solution to the problem.

4. Choose the best solution to your problem.

Similarly, the computer is designed to solve problems for you, the user. How is this possible? A computer solves end-user problems by following a set of instructio­ns given to it by the programmer and produces the specified results.

The computer programmer creates the instructio­ns for the computer to follow. These instructio­ns are referred to as computer programs.

A computer program is a finite set of clear and specific instructio­ns, written in a programmin­g language.

The problem-solving phase in computing consists of the following steps:

1. Define the problem.

2. Propose and evaluate solutions.

3. Determine the most efficient solution.

4. Develop the algorithm (an algorithm may be defined as a sequence of logical steps used to solve a problem).

5. Test and validate the solution.

BASIC TREATMENT OF THE STRUCTURED APPROACH FOR SOLVING COMPLEX PROBLEMS

When we have large problems to solve in the computing world, we apply the divide-and-conquer concept. The divide-and-conquer approach involves decomposin­g a large, everyday problem into smaller tasks.

When faced with a complex problem, it is easier to break down the problem into smaller, more manageable sections and tackle each section as a separate entity, rather than trying to solve the large problem in one go.

Let’s assume you were creating a program to simulate the basic operations of a calculator.

Below is a diagram depicting the divide and conquer concept.

As you may observe with the diagram above, there is a major problem which has been broken down into two sub-tasks. Each subtask may have specified action(s) that will be carried out to solve the overall problem.

DEFINING THE PROBLEM

Defining the problem is a way to help the programmer understand what he or she is required to do. It involves breaking down the problem into three key components:

1. What is given (that is, the inputs).

2. The tasks that must be performed (that is, processing).

3. The expected results (that is, the output).

These three components can be illustrate­d using what is a called a defining diagram. Some texts may refer to this as the Input Processing and Output (IPO) chart. The defining diagram is a formal approach to defining a problem. The defining diagram is a table with three columns, which represents the three components: input, processing and output.

THE INPUT

The input is the source data provided. You can identify what is the input in a given problem by the following keywords: given, get, read or accept.

THE OUTPUT

The output is the end result required. You can identify what is the output in a given problem by the following keywords: print, display and output.

THE PROCESSING

The processing column is a list of what actions are to be performed to achieve the required output.

Let us look first look at a real-world scenario. You are learning to bake a cake for the first time. How would you represent this problem using the defining diagram concept? See the example below.

KEY TERMS/VOCABULARY

■ Problem-solving

■ Problem-solving steps/phase

■ Divide-and-conquer

■ Defining the problem using a defining diagram

We have come to the end of this lesson. See you next week, when we will continue to look at problem solving and program design. Remember, if you fail to prepare, you prepare to fail.

 ??  ?? Next week, we will examine a computer-related problem using the defining diagram. DEFINING DIAGRAM
Next week, we will examine a computer-related problem using the defining diagram. DEFINING DIAGRAM
 ??  ??

Newspapers in English

Newspapers from Jamaica