Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTRODUCTION TO PROBLEM SOLVING

Similar presentations


Presentation on theme: "INTRODUCTION TO PROBLEM SOLVING"— Presentation transcript:

1 INTRODUCTION TO PROBLEM SOLVING
GRADE 11 SEPTEMBER REVIEW OF TOPIC SOURCES: Information Technology for csec 3rd ed Skeete and Skeete CSEC syllabus, Oxford IT for CSEC

2 CSEC SPECIFIC OBJECTIVES (1-6)
Students should be able to: 1. outline the steps in problem-solving; CONTENT Definition of the problem; propose and evaluate solutions; determination of the most efficient solution; develop and represent algorithm; test and validate the solution. 2. decompose a simple problem into its significant parts(components); The components are: input; process; storage; output

3 SPECIFIC OBJECTIVES (CONT’D)
3. distinguish between variables and constants; CONTENT Variable: an area of storage whose value can change during processing; the value of a constant never changes.

4 SPECIFIC OBJECTIVES (CONT’D)
4. use appropriate data types; CONTENT Integers, floating point (real), characters, literals. 5. explain the concept of algorithms; Definition of algorithms; Characteristics: finite number of steps, precise, unambiguous, flow of control from one process to another, terminate.

5 SPECIFIC OBJECTIVES (CONT’D)
6. Identify ways of representing algorithms; Representation of algorithms as Pseudocode or Flowcharts; Use of flowchart symbols: input/output, process, decision, directional arrows. Pseudocode - Use of: Read, Input, Store Write, Output, Display, If-then; If-then- else; For loop; while loop; (questions which require nested conditionals or nested loops will not be asked).

6 What is a computer program?
A computer program is a set of computer instructions, which are used for solving a problem. The program directs the computer to perform the actions that are needed to arrive at a solution. The number of instructions required to solve a problem depends on the complexity of the problem. These instructions may range from a few to many hundreds or thousands.

7 What is a problem (in computing)
One definition is: A discrepancy between what is required and what exists. ________________________________________________________ A computer program is meant to solve a problem. Think of a programming problem in the same light as you would think of a mathematical problem. It's not something bad(though some people may say otherwise). Rather, it is something that needs to be solved or a task that needs to be accomplished.

8 Phases of program design
How should you design programs? Whenever you are designing programs, there are two main phases: 1 The problem-solving phase. Ideally you shouldn't touch the computer during this phase. 2. the implementation phase (covered in section two of your syllabus). This is where you take the designs you came up with during the problem-· solving phase and implement them on the computer.

9 The five main problem-solving steps
Whenever you attempt to solve a problem, there are certain steps you should follow. 1. Define the problem. 2. Propose and evaluate solutions. 3. Determine the most efficient solution. 4. Represent the most efficient solution in the form of an algorithm. 5. Test the algorithm.

10 What is an algorithm? An algorithm is a formal sequence of instructions that defines a solution to a problem. The word 'a' is emphasized because a problem may have more than one solution. In a sense, an algorithm is sort of like a recipe - but for computers. You will learn a number of ways to represent algorithms, but whatever method you use there are certain characteristics that are required.

11 Defining the problem In order for you to come up with an algorithm to solve a problem, you must first have a clear understanding of what the problem is. The first thing you have to do is to obtain a problem statement (a clear definition of the problem that needs to be solved). At this level it will usually be provided for you, but in the real world the programmer would have to work with his client to come up with one.

12 Defining the problem Here are some (very simple) examples of problem statements: The program must read two numbers and print the larger of the two. Write a program that reads three numbers and displays their average.

13 Determining the input, output, processing and storage
The next step in defining the problem is to break it down into its main components: 1 Inputs - the data you are provided with or have to obtain from the user. Some words that help you to identify the inputs are: read, input, enter, given, accept 2 Outputs - the results that should be produced 3 Processing - the tasks that must be performed, i.e. what must be done with the inputs to get the outputs 4 Storage - the data that must be stored

14 Defining diagrams One way of illustrating the main components of a problem is by using a defining diagram. A defining diagram is a table with three columns: 'Input', 'Processing' and 'Output'. Consider the following problem statement: Write a program that reads two numbers and prints the total. Even this simple statement requires some detective work to figure out the input, output and especially the processing.

15 Input The word 'read' tells us that the inputs will be in the form of two numbers. For reasons that will be explained later, it's helpful to give the inputs names, so we'll call them numl and num2. Output The desired result is the total, so we'll call the output 'total'.

16 Processing Each task that must be performed counts as processing. Reading the two numbers is processing and so is printing the total. But is that everything? The total doesn't magically appear. You have to do something to the inputs to obtain the total. So there is an in- between step that is implied - calculating the total. Therefore, the defining diagram would look like this:

17 Input Processing Output two numbers, say Read two numbers. total
1 Read two numbers. total numl, num2 2 Calculate the total. 3 Print the total.


Download ppt "INTRODUCTION TO PROBLEM SOLVING"

Similar presentations


Ads by Google