Presentation is loading. Please wait.

Presentation is loading. Please wait.

Step 1:Identify and Define the problem

Similar presentations


Presentation on theme: "Step 1:Identify and Define the problem"— Presentation transcript:

1 Step 1:Identify and Define the problem
We define the problem by first ensuring that the problem is clearly defined or correctly phrased. If it is not it should be modified to make sure that it is clearly stated. Once the problem is well understood, it can be solved easily

2 STEP 2 – ANALYZE THE PROBLEM
The problem need to be further defined. This can be accomplished by decomposing the problem into three key components: What is given (the inputs) The tasks that must be performed (processing) The expected results (the output)

3 THE DEFINING DIAGRAM OR IPO CHART
We analyze the problem by constructing a defining diagram or IPO Chart - A table with three columns which represents the three components: input, processing and output. Input refers to the source data provided - easily identified by the keywords – given, read or accept, input, enter Output refers to the end result required - keywords are print, display, produce, output, show Processing are the actions which must be performed to achieve the required output - it answers the question: What must I do with the inputs in order to produce the desired result? - Keywords – add, if, repeat, calculate, total, work out, find, determine

4 Problem 1: A program is required to read three numbers and calculate and print the total. IPO CHART INPUT PROCESSING OUTPUT 3 numbers Say num1, num2, num3 Read/get 3 numbers Add numbers together Print total Total

5 Problem 2: Enter the base and height of a triangle and find and print the area. IPO CHART INPUT PROCESSING OUTPUT Base, Height Read/get Base, Height Calculate the area Print the area Area

6 Problem 3: Add the weights of two people to show their weights. IPO CHART INPUT PROCESSING OUTPUT 2 numbers Say weight1, weight2 Read/get 2 numbers Add the numbers together Print the total weight Total_weight

7 Problem 4: Given three integers representing the age of three boys respectively, find and display their average age as well as the age of the eldest boy. IPO CHART INPUT PROCESSING OUTPUT 3 integers Say age1, age2, age3 Read/accept/get 3 integers Find the average age Find the highest age Print the average age, highest age Average_age, Highest_age

8 Problem 5: The cost of a new car is the sum of the wholesale cost, the local sales tax and the dealer’s percentage mark-up. Assuming that the dealer’s mark-up is 10 percent of the wholesale cost and the sales tax is 6 percent, design an IPO chart to read a car ID (an integer value) and the wholesale cost of the car (a real value) and print the car ID and the cost to the consumer.

9 IPO CHART Car-ID, Wholesale-cost Read/get Car-ID
INPUT PROCESSING OUTPUT Car-ID, Wholesale-cost Read/get Car-ID Read/get Wholesale-cost Calculate dealer’s mark-up Calculate the sales tax Find the sum of the wholesale-cost, the dealer’s mark-up and the sales tax (Consumer_Cost) Print the Car ID, Consumer Cost Car-ID, Consumer-Cost


Download ppt "Step 1:Identify and Define the problem"

Similar presentations


Ads by Google