1. Mindanao Polytechnic College GSC
Mindanao Polytechnic College
General Santos City
Steps in Programming and
Development
Narene M. Nagares, MIT
Department of Information Technology
2. Mindanao Polytechnic College GSC
Steps in Programming
• Programming is a problem-solving activity. A
person with good problem solving skills will
tend to be a good programmer. To develop
this skill, a programmer must practice the
following steps:
COMP1 - Computer Fundamentals & Programming 2
3. Mindanao Polytechnic College GSC
I - Problem Analysis
1. The first step is to determine the output, which
is the goal or purpose of solving the problem.
When you identify the output, it will then be
easier to find which information is required to
reach that output.
2. Determine the input, which is the information
needed to reach the goal or output.
• You cannot solve a problem unless you understand it, and you
cannot understand a problem unless you analyze it. An example is
shown on the next slide.
3
COMP1 - Computer Fundamentals & Programming
4. Mindanao Polytechnic College GSC
Treyson Mobley problem:
• Treyson Mobley wants a program that
calculates and displays the amount he should
tip a waiter at a restaurant. The program
should subtract any liquor charge from the
total bill and then calculate the tip (using a
percentage) on the remainder.
4
COMP1 - Computer Fundamentals & Programming
5. Mindanao Polytechnic College GSC
Treyson Mobley problem- IPO Chart
5
COMP1 - Computer Fundamentals & Programming
• Here is an example on how to construct the IPO
(Input-Processing-Output) Chart for the given
problem. The goal of the program is to calculate and
display the tip for the waiter. This is the output.
• And to solve for the tip, we need the following
inputs, which are stated in the problem, total bill,
liquor charge and tip percentage.
6. Mindanao Polytechnic College GSC
Other Examples:
• Jack Osaki earns $7 per hour. Last week, Jack worked 50
hours. He wants a program that calculates and displays his
weekly gross pay.
• Jack wants to know his weekly gross pay, this is the output.
To solve for the pay, we need the rate per hour and the
hours worked, these are our inputs. Note how the values
for his hourly rate and worked hours did not matter in our
IPO chart. This is because those numbers can vary or
change overtime.
6
COMP1 - Computer Fundamentals & Programming
Input Processing Output
rate per hour
hours worked
Processing item: none weekly gross pay
7. Mindanao Polytechnic College GSC
Other Examples:
• Caroline Casey wants a program that calculates and
displays the area of any rectangle.
• In this example, the length and width were not
explicitly stated in the problem because there is
already a presumption that you know the formula on
how to solve the area of a rectangle.
7
COMP1 - Computer Fundamentals & Programming
Input Processing Output
length
width
Processing item: none area of a rectangle
8. Mindanao Polytechnic College GSC
II – Setting up an Algorithm
• Write the instructions that will transform the
input into the output.
1. Enter some data (input items)
2. Process data
3. Display some data
*Algorithm - set of step-by-step instructions that
describe how to accomplish a task. In other words,
an algorithm is a solution to a problem, usually by
performing some calculations. (begins with a
verb)
8
COMP1 - Computer Fundamentals & Programming
9. Mindanao Polytechnic College GSC
Treyson Mobley problem – IPO Chart
9
COMP1 - Computer Fundamentals & Programming
10. Mindanao Polytechnic College GSC
Planning Tools
Pseudocode - short english statements that
resembles programming language
instructions. An example of an algorithm using
pseudocode is shown from the previous slide.
• Flowchart - uses standardized symbols to
visually depict an algorithm.
10
COMP1 - Computer Fundamentals & Programming
13. Mindanao Polytechnic College GSC 13
The processing item is neither an input
nor an output. It is an added item to make
computations simpler.
14. Mindanao Polytechnic College GSC
Complete an appropriate IPO chart, using pseudocode
AND flowchart in the Algorithm section. (Activity 5)
1. Kendra Chopra lives in a state that charges a 5% sales tax. She wants a
program that displays the amount of sales tax due on a purchase.
2. Wilma Peterson is paid by the hour. She wants a program that calculates
her weekly gross pay. For this exercise, you do not need to worry about
overtime pay, as Wilma never works more than 40 hours in a week.
3. Party-On sells individual hot/cold cups and dessert plates for parties. Sue
Chen wants a program that allows her to enter the price of a cup,the
price of a plate, the number of cups purchased, the number of plates
purchased, and the sales tax rate. The program should calculate and
display the total cost of the purchase.
4. The sales manager at Colfax Products wants a program that allows him
to enter the sales made in each of two states. The program should
calculate and display the commission, which is a percentage of the total
sales.
5. Jenna Williams is paid based on an annual salary rather than an hourly
wage. She wants a program that calculates the amount of her gross pay
for each pay period.
14
COMP1 - Computer Fundamentals & Programming
15. Mindanao Polytechnic College GSC
III - Coding
• After having set up the algorithm, the next step is
translate or convert the algorithm into a list of
instructions in a code or language that the
computer can understand and execute.
• The list of instructions understood by the
computer is now called a program.
• The list of instructions that will implement the
algorithm can be understood by the computer
simply because "it is written in the vocabulary of
the programming language and conforms to the
grammatical rules of the language.
15
COMP1 - Computer Fundamentals & Programming
16. Mindanao Polytechnic College GSC
IV – Running, Testing & Debugging
• The fourth step in program development would
be to execute or run the program. The program is
executed or run on different input data.
• Testing is the art of creating different sets of
sample data upon which the program will be run.
– Desk checking - the process of executing a program
with test input data and checking the output results
against the requirements.
• Bugs - errors that come out during program execution
Debugging – the art of correcting errors.
16
COMP1 - Computer Fundamentals & Programming
17. Mindanao Polytechnic College GSC
V – Documentation
• Three basic types:
– User Manual - contains information on the software
and hardware requirements, installation procedures,
and step-by-step instructions on how to use the
system.
– Technical Manual - is a printed copy of the
information regarding how the program was designed
and how it was created.
– Internal Manual - has the same info with TM but these
are stored within the program themselves, through
the use of comments.
17
COMP1 - Computer Fundamentals & Programming