0% found this document useful (0 votes)
28 views

Lesson 2-Basics of Program Development

This document discusses the basics of program development. It defines a program as a set of logical computer instructions designed to solve a problem in a specific programming language. A programmer is someone who writes computer programs. Good programmers are logical thinkers, analytical, good communicators, and creative designers. There are several phases to program development: problem analysis to understand requirements, designing the solution, implementing the program, testing it, and maintenance. Problem analysis involves understanding the inputs, processes, and desired outputs. Pseudocode and flowcharts can help design the solution before implementation in a programming language.

Uploaded by

Jonas Sison
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lesson 2-Basics of Program Development

This document discusses the basics of program development. It defines a program as a set of logical computer instructions designed to solve a problem in a specific programming language. A programmer is someone who writes computer programs. Good programmers are logical thinkers, analytical, good communicators, and creative designers. There are several phases to program development: problem analysis to understand requirements, designing the solution, implementing the program, testing it, and maintenance. Problem analysis involves understanding the inputs, processes, and desired outputs. Pseudocode and flowcharts can help design the solution before implementation in a programming language.

Uploaded by

Jonas Sison
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

LESSON 2:

BASICS OF PROGRAM DEVELOPMENT


LEARNING OBJECT IVES
After going through this lesson you would be able to:
 know and understand what a program is
 identify the different characteristics of a good programmer
 differentiate between pseudocode and flowchart
 create a solution for the problem using pseudocode and flowchart
 explain the different phases of program development process
WHAT IS A PROGRAM?
Let us start by defining the keyword in this section. These definitions will emphasize the
characterization and provide the mindset needed to understand and appreciate the main output of our
programming task—a program. A quick search from the web returns the following definitions from key online
sources.
Webopedia defines program as an organized list of instructions that, when executed, causes the computer
to behave in a predetermined manner. (www.webopedia.com)
Wikipedia defines a computer program as a sequence of instructions written to perform a specified task
for a computer. (www.wikipedia.com)
TheFreeDictionary provided a similar definition for program as “a sequence of instructions, stored in
any medium, which can be interpreted and executed by a computer.” This term is used both for the written
program (a document) and for its corresponding electronic version stored or executed on the computer.
(www.freedictionary.com)
You may have to perform a web quest and search for the many definitions of a program to add up to our
initial list above. You may derive and come up with your own definition based from your comprehensive web
quest and combining key thoughts.
For our study, we provide the following definition as a fusion of the definitions above.
“A program is a set of sequence detailed, logical and finite computer statements
designed to solve a problem and coded using a specific programming language.”

Who develops programs?

It may seem quite refreshing to recall the following:


He who farms is called a farmer.
He who bakes is a baker.

1|P a g e
He who teaches is a teacher.
He who cooks is a ____________.  (a cooker?!?)
And… he who programs is a programmer.

Thus, we say that a programmer is the key person charged of producing a program. From our several
definition of a program listed above, it becomes imperative to expect the following competencies from a
programmer:

 Logical Thinker, thinks in a manner consistent with principles of correct thinking


 Analytical Explorer , digs deeper into the issue at hand and finds ways to interconnect data
 Good Communicator, able to convey information and comprehend likewise
 Creative Designer, seeks for better presentation and organization
And the dispositions and attitudes to be evident include being:

 Patient, enduring and does not easily give up


 A team player, works cooperatively with others
 Inquisitive, asks questions and clarifies matters

THE PROGAM DEVELOPMENT PROCESS


Programming is a very logical task. It entails a clear understanding of the problem at hand. It would require
digging deeper and asking more questions to finally bring the problem to the surface. The problem may need to
be unearthed as some user requirements do not spell the problem as exact as need be.
Consider for instance the President of Phinma Education Network commissioning a programmer, “There
is a need for the company to generate a list of employees who have served for at least five years so we can organize
a special recognition ceremony for their loyalty.”
It would appear a simple task computing for length of service. We just need to consider the year when the
employee started service and subtract the same from the current year. A difference of at least 5 years would
automatically qualify the employee for the loyalty award. A closer look, however, would reveal that we need to
ascertain more than what we have at the surface. Does the President intend to include both teaching and non-
teaching staff? Will this include full-time and part-time faculty members? Will a contractual employee qualify?
These concerns have to be addressed so that the list generated by the program satisfies the scope required by the
President.
Analysis and evaluation of required inputs and desired outputs are prerequisites for determining the
process appropriate to meet the specifications. The requirements may be changed and modified as discussions
and exchange of views are conducted between the developers and the commissioning party. In some instances,
the user may even have a vague description of what he needs or even change minds and expectations. Ultimately,
the goal is to fuse user’s expectations, available technology, resource allocation and other related factors. Suffice
to say then that programmer write programs to meet the agreed requirements of others.

2|P a g e
Programming is also a creative task. Designing an appropriate solution to a problem also entails that the
program-developer is able to conceptualize a presentation that is fit and suitable to the target end-users. The
interface may be enhanced with colors and layout schemes to better provide an interaction of least eye glare,
reduced monotony and engaging user interaction. Because a program is a product in itself, user acceptability is
very important. When a user is satisfied with the use of the program because of simplicity, ease of use and
functionality, the program is characterized as user-friendly.

The figure below depicts the several phases of the program development process.

Figure 1. The Program Development Process

Phase I: Problem Analysis


Phase I is referred to as the Problem Analysis stage. This is where problem identification occurs and is
deemed the critical part of the entire process. The inability to track the right problem requirement leads to an
erroneous solution and therefore an incorrect design and final product. This is better captured by the saying
Garbage In, Garbage Out.
Consider the following example:
Example 1: From a user’s input of two nonzero, nonnegative integers, determine their greatest common
factor (GCF) and least common multiple (LCM).
At this stage of problem analysis, it would be helpful to determine the requirements using the IPO (input-
process-output) approach. Ideally, we determine the input, process and output requirements in the given sequence
and order. However, you may identify ahead the input and output requirements before determining the appropriate
process needed to convert the input to the desired output. A backtracking may also be applied. When the output
requirement is clearer at the onset, you may perform assessment on the process and input requirements based
from the output specifications. There is no rule-of-stone as to which entity you are to start off with. It is important,
however, that you are able to link the three entities and strike their logical interrelations before finally proceeding
further. In the process identification, it is possible you provide the primary process initially at the onset. The
process requirement may need elaboration and detailing of the secondary and intermediate steps when you reach
the Solutions Mapping phase. This is necessary when the problem entails multi-step operations before the final
output is produced.
The following questions are presented as a guide in problem analysis:
INPUT
o Is there an input requirement?

3|P a g e
o If so, how many and of what type?
o Where is the input expected to come from—the program user, generated automatically by the
computer, or from an external file?
o Is there a format requirement when receiving the input?
o At what stage of the operation will the inputs be received?
PROCESS
o What steps are appropriate to covert the input to the desired output?
o What operators are to be used to produce the results?
o Is the solution complex and requires multi-step operations?
o What is the proper sequence of the steps if the operations are compound?
OUTPUT
o Is there an output requirement?
o If so, how many and of what type?
a. Where is the output expected to be directed—on the display screen, on a hard copy or
stored to a file?
b. Is there a format specification for the output?
o When are the outputs expected to be displayed?

Using the examples given earlier, let us try sorting out the requirements using the IPO approach.
Example 1: From a user’s input of two nonzero, nonnegative integer, determine their greatest
common factor (GCF) and least common multiple (LCM).
o Input Requirement
2 input values : nonzero, nonnegative integers (whole numbers)
o Process
Compute for the Greatest Common Factor (GCF): an integer
Compute for the Least Common Multiple (LCM): an integer
o Output Requirement
2 output values: greatest common factor and greatest common multiple: both are integers
The manner may vary as to how you specify and put into words the entries under each domain of the IPO.
That is acceptable. This is where differences may emerge among programmers. Just the same you should be
pointing out to the same items. What is important is that the IPO entries are complete, clear and consistent. You
may need to draft and re-work a multiple number of times until you are convinced of its clarity and completeness.
After which, it is time to move on to the second phase.

4|P a g e
Phase II: Solution Mapping
Phase II is the Solution Mapping stage. This entails planning the logic of the solution and requires
specifying the details and steps of the solution. It is stressed that the steps and opertions should be logical and
directed towards the solution of the problem. The creative aspect is tentatively not the priority at this stage. In
designing solutions, remember that form follows function. In other words, the main focus is the correctness and
completeness of the solution; anything pertaining to the design will only be secondary. You should not devote
excessive time in the aesthetics of the solution and forgetting the heart of the problem. A working and correct
program with simple presentation is desired rather than an incorrect program even though enhanced with colorful
layout.
The steps and operations you have identified in the Process domain of the IPO approach may not yet be
detailed. In this stage, however, it is necessary to spell out the individual steps needed to carry out the solution.
To reiterate, a program is expected to be detailed since you needed to design instructions for the computer machine
to execute. Our inability to bring details may result to non-completeness of our desired results.
In programming, we speak of a solution as an algorithm.
What is an algorithm?
The word algorithm stem from Algoritmi, the Latin form of the name of Abū Abdallāh Muhammad ibn
Mūsā al-Khwārizmī, a Persian mathematician, astronomer and geographer (among others of his achievements)
whose systematic approach to solving linear and quadratic equations led to algebra. Al-Khwarizmi is considered
the founder of algebra.
An algorithm is a detailed, sequenced and ordered set of instructions designed to solve a problem. An
algorithm is basically a program minus the specific programming language. In presenting our algorithm, two
schemes are available—using pseudocodes or using flowcharts. A pseudocode is like what it says—pseudo which
means false; so we have false codes. This means that the codes we specify need not make use of any programming
language codes. It may be expressed using English-like structure and may simply be enumerated to signify
sequence and order.
PSEUDOCODES
Pseudocodes may be thought of as drafts for your programs. The pseudocode observes a free format and
presentation may be as simple as enumerating the steps to be undertaken to complete the solution.
In the first example, let us design our solution or algorithm using pseudocodes, as follows:
Compute for the Greatest Common Factor (GCF):
o Divide the 2 values starting with the smaller value as divisor.
o When both values do not return a remainder, the divisor is the GCF, this may now be
printed and execution stops.

5|P a g e
o If not, repeatedly reduce the divisor by 1 and perform check of remainder until a GCF is
found.
o The least possible GCF is 1 for any valid input values.
Another way to specify the pseudocode is as follows:
1. Determine the smaller value between the inputs, tag this as S
2. Set a divisor starting at S
3. If S is equal to 1, stop. This is the
GCF. Otherwise, proceed to step #4.
4. Divide individually the 2 inputs by S
5. If no remainder exists for both inputs, stop. The GCF
is S. Otherwise proceed to step #6.
6. Decrease S by 1 and goto step #3
FLOWCHARTING
Flowcharts are graphical representation of the solution to the problem. Flowcharting is a common choice
among programmers for algorithm presentation purposes. The non-programmer will most likely be able to
comprehend better the flow of operations when presented a flowchart rather than the text-based pseudocodes. The
flowchart makes use of symbols such as ovals, rectangles and diamonds, each one denoting specific action and
purpose.

As a starter, let us design a simple flowchart for a short problem.

Example #2: Compute for the tuition fee for a given number of units and per-
unit rate.
Pseudocode:

1. Receive the number of units


2. Receive the per-unit rate
3. Multiply the number of units with the per-unit fee to arrive at the
tuition fee
4. Display the computed fee

The equivalent flowchart for the above pseudocode is presented beside this
example.

The sample flowchart observes a simple sequence. There are 3 identifiers used—units, rate and fee. When
the user types in the units and rate, the value is mapped with the identifier units and rate, respectively. The

6|P a g e
computed product of units and rate is mapped with the identifier fee. Finally, the computed fee is displayed as an
output.

Flowcharting is especially designated a separate section in this manual. Sample exercises are provided for
better understanding and for practice purpose.

Phase III: Coding


Phase III is the Coding stage and requires choosing the appropriate programming language to translate
the solution into codes. Somehow, at the very onset, the programmer already has in mind the appropriate
programming language. As such, in the discussions with the commissioning client for the finalization of
specifications, the program developer has in mind the strengths and limitations of the language intended for use.
The competence of the programmer in the language is another significant consideration in the choice of
the language. Given different programming languages in the same area of domain, the programmer has to choose
the one where he is more adept with. It is then a challenge to any programmer to attain more than just a basic

7|P a g e
working knowledge of a programming language. Being able to confidently navigate and use advanced features of
the language will result to a more sophisticated and powerful program yet simplified for the users.
Coding involves the translation of the solution into a statement consistent with the syntax of the
programming language. A language’s syntax dictates the structure and organization of the statements. These
statements shall be converted by the programming language itself into a format that the computer is able to
recognize and execute.

Phase IV: Debugging and Testing


Phase IV is the Debugging and Testing stage. As necessary, the coded solution is subjected to multiple
error checking and test-execution to assess its correctness and compliance to expectations.
Two general categories of errors exist—compile-time and runtime errors—which characterize when
these errors are detected.
Each programming language has its own set of keywords, statements, constructs and rules. The
programmer designs the program using the functionalities available in the language and has to comply with the
rules. Errors in the program may be a violation of the language’s grammar and rules. This type of error is referred
to as syntax error and may include excess or omission of a symbol, incorrect spelling, or wrong case setting.
Errors which are syntactic in nature are detected during the compilation process, thus the name compile-time
errors.
Phase V : Documentation and Production
The last phase of the Program Development Process is the Documentation and Production stage.
Documentation pertains to the preparation of both soft and hard copy of the program. Functions and special
routines in the program are elaborated through comments and templates designed by the organization for this
purpose. The documentation process is a requirement especially for big projects that often are modified through
time. The documentation will serve as the blueprint for the program and will guide programmers’ enhancement
work in the future. Likewise, the documentation endeavor may include a user’s manual that specifies actions to
be taken when errors in operation occur and troubleshooting is necessary. The technical manual, on the other
hand, specifies details on requirements on hardware, software and users, including installation steps as necessary
for the deployment and production of the program, perhaps as part of a bigger project.

8|P a g e

You might also like