Problem Definition and Analysis
Problem Definition and Analysis
:
Programming
Name: Bencalo, Mark Emmanuel L. Section: EE21S1
Date Performed: October 27, 2021
Date Submitted: October 27, 2021
Instructor: ENG'R. JULIE ANN B. SUSA
1. Objective(s):
The activity aims to introduce the significance of algorithm and flowchart in creating a program using C++
programming language base on the requirement.
3. Discussion:
In program development, there are steps/procedures that have to follow. Figure 1. shows the
program development life cycle.
Problem Definition
and Analysis
Design
Implementation
Testing
The first step in solving a problem is to define and analyze the problem. The purpose of
defining and analyzing a problem is to determine the goal of solving a problem and the items that are
needed to achieve that goal. Programmers refer to the goal as the output, and they refer to the items
needed to achieve the goal as the input. In defining and analyzing a problem, always search first for the
output, and then for the input. Some programmers use an input, process and output (IPO) chart to organize and
summarize the results of problem definition and analysis. Table 1 shows how to make use of IPO. The details
discussion of the chart is in the second step of problem-solving process.
1. Processing items:
2. Algorithm:
a. Narrative form:
b. Pseudocode
Design
Algorithm
The second step in the problem-solving process is to plan a design using analytical tools such
as algorithm and flowchart. Algorithm has two different forms, a narrative form or short English
statements and statements closer to the instructions in the program which is called pseudocode. These two
forms of algorithm have the same output which is the steps/procedures in developing the programof the
given problem. Record the algorithm in the processing column of the IPO chart. Most algorithms begin with
an instruction that enters the input items into the computer. The Input items are the items listed in the
Input column of the IPO chart. A processing item represents an intermediate value that the algorithm uses
when processing the input into the output. Most algorithms end an instruction to display, print, or store the
output items listed in the Output column of the IPO chart.
A programmer reviews an algorithm by desk-checking, or hand-tracing, it in other words, by
completing each step in the algorithm manually. You desk-check an algorithm to verify that it is not
missing any steps, and that the existing steps are correct and in the proper order. Before you begin the
desk-check, first choose a set of sample data for the input value, which you then use to manually
compute the expected output values. If every step has no errors, a programmer now can construct a
flowchart.
Flowchart
Only after the programmer is satisfied that the flowchart is correct does he or she then move
on to the fourth step in the problem-solving process which is implementation. Implementation is a step
where the programming is converting the designs into codes. A code is a language that the computer
can understand.
After completing the codes, the programmer then desk-checks the program to make sure that
the algorithm and flowchart were translated correctly, then final process in the problem-solving process can
be done.
Testing
The final step in the problem-solving process is to test if the codes have no errors using the
component of a programming language such as compiler or assembler that detects errors. This is
usually done by entering, into the computer, the C++ instructions listed in your algorithm. Other
instructions required by the C++ compiler have to be entered as well. After entering the appropriate
instructions, you then run (execute) the program. (More details will be discussed in Activity no. 2.)
4. Resources:
DevC++
Sarah Cruz has been working for COMPUTER Z Company for four years. Last year, Sarah received a 5%
raise, which brought her current monthly pay to 25,000.00 pesos. Sarah is scheduled to receive a 4% raise
next month. She wants to write a program that will display, on the computer screen, the amount of her new
monthly pay.
-The required problem is to write a program/ display her new 4% raise that is said to be added
next month.
-The input items are Sarah’s 25,000 pesos monthly pay and the 4% raise that she will be
receiving next month.
3.What is/are the processing item/s?
-The processing items are new income = previous income + (previous income x pay raise/100).
-The output will be the new income that Sarah is expected to receive next month.
ALGORITHM
NARRATIVE PSEUDOCODE
-Start the programming
language. To calculate the new Step 1: Start the
income, state the previous programming language.
outcome and the state the Step 2: Enter the 25,00php
percentage pay rises. Compute (previous income).
the new income by Previous Step 3: Enter the percentage
Income (Previous Income x pay pay raise.
raise/100). Display the New Step 4: Compute new
Income and end the income = previous income
programming language. (previous income x pay
raises/100).
Step 5: Display the New
income.
Step 6: End.
FLOWCHART
Start
Enter the
25,00php (previous
income)
Print the
New
income
End
EXERCISE No. 2 (Problem Involving Condition)
A student took four quizzes in a term and would like to compute their average. He also would like to know if the average has
a passing mark. Note that grade lower than 75% is failed.
Step 1: The required is the average of the four quizzes and to know if it passed or failed.
Step 2: The score of the four students on their quizzes and the total number of quizzes that
they have taken.
Step 3: The processing items are the total score, total number of items and is divided to 100.
Step 4: The outputs are the Average of the four marks and to identify if the grade is lower that
75% or higher.
ALGORITHM
NARRATIVE PSEUDOCODE
-Start the programming language Step 1: Start the programming
and state the 4 quizzes scores. Add language.
up the total marks. Calculate the Step 2: Enter the 4 quizzes scores.
average by dividing the total scores Step 3: Enter the total sum of quizzes
by four. Calculate the percentage of Step 4: Compute the average by Total
score by Total score divided by Total scores of quizzes divided by 4.
number of items times 100. If the Step 5: Compute percentage by (Total
percentage is less than 75% then score divided by total number of
display failed, Else If the student items) x 100.
percentage is greater than 75% then Step 6: IF percentage is <75%.
display passed. End the Step 7: Display Failed.
programming language. Step 8: Else, IF Percentage is > 75%.
Step 9: Display Passed.
Step 10: End.
FLOWCHART
Start
Compute Percentage =
(Total score / Total
number of items) / 100
IF Percentage is
< 75% Print
Failed, IF P is >
75% Print
Passed.
End
EXERCISE No. 3 (Problem Involving Iteration)
ALGORITHM
NARRATIVE PSEUDOCODE
Step 1: Start the programming
-Start the programming language.
language, and state the 10 Step 2: Enter the 10 numbers.
numbers that are separated, read Step 3: Read reply to numbers
the reply to console and loop. If then Loop the numbers.
the reply says blank, break the Step 4: IF the reply is blank,
loop. Get the number from the break, get the number from
reply and add 1 to a count. Get reply.
the summation of the numbers Step 5: Add 1 count and total
and repeat, write “the total is:” the numbers.
then End The programming Step 6: Repeat.
language. Step 7: Write “the total is:”
Step 8: End.
FLOWCHART
Start
Enter the 10
numbers
End
6. Conclusion:
-I have realized how satisfying the computer language are, it gives me a huge advantage and makes things
easier. The problems were really confusing at first, but it helps me improve my analyzing skills to the fact that
I can identify what is the proper formula to be used. Each problem was interesting, and it help me develop my
problem-solving skills, it was hard identifying the process but at the end of the activity I managed to have the
grasp the given task. Furthermore, the activity was fun and continued to aspire me into computer programing.