Chapter 14 :
PROGRAMS AND PROGRAMMING
What is a program?
A list of instructions for the computer to follow to
accomplish a task of processing data into
What is programming?
Also known as software development / software
development life cycle(SDLC)
A six step procedure for creating that a list of instructions
STEP 1 : PROGRAM SPECIFICATION
Also called program definition or program analysis
Requires: programmer and end user
1- Program objectives : the first task is to clearly define the problem to
solve in the form of program objectives.
2-Desired output : focus on the desired output before considering the
3-Input data : once outputs are defined ,determine the necessary input
data and the source of the data.
4-Processing requirements : determine the steps necessary
(processing requirements) to use input to produce output.
5-Program specifications document : to record this step’s program
objectives ,outputs, inputs and processing requirements.
STEP 2 : PROGRAM
Plan a solution using structured
These techniques consist:
1) Top down program design
To identify the program's processing
Such steps are called program
Each module are made up of logically
related program statements
Example time and biling report
An outline of the logic of the program
you will write
It is like doing summary of the program
before it is written
These graphically present the detail sequence
of steps needed to solve a programming
The best way to link the various part of the flowcharts is by
combines three logic structures called concatenation
,selection and repetition.
In the concatenation structures-one program statements
follow another. There is no question of “yes” or “no” of the
decision suggesting other consequences.
The selection structures(IF-THEN-ELSE)- occurs when a
decision must be made.
The repetition or loop structures describe a process that
may be repeated as long as a certain condition remains
The structures is called “loop” or “iteration” because the
program loops around again and again
The repetition structures has two variation DO UNTIL
and DO WHILE
STEP 3 : PROGRAM CODE
Writing the program is called CODING
ASPECTS OF WRITING A PROGRAM
Good programs are reliable ,detect obvious and common
errors and are well documented.
The best way to create good programs is to write
structured programs using the three basic logic structures
presented in steps 2.
There are hundreds of different programming languages.
Two types are:
Content mark-up language-instruct a computer how to
process different types types of information. Example
HTML used to create web pages.
Programming language-instruct a computer to perform
specific operations. C++ is widely used programming
STEP 4 : PROGRAM TEST
Debugging is a process of testing and
eliminating errors in a program
Syntax and logic are two types of
A violation of the rules of the programming language
Example in C++, each statement must end with a semicolon(;)
Occur when the programmer uses an incorrect calculation or
leaves out a programming procedures
Example, failure to include calculation of overtime hours in a
payroll program in a logic error
Five methods for testing for syntax and logic error are
1)Desk checking(code review):careful reading of a printout of the program.
2)Manual testing :using a calculator and sample data to test for correct
3)Attempt a translation: running the program using a translator program to
identify syntax errors.
4)Testing sample data: running the program and testing the program for
logic errors using sample data.
5) Testing by users (beta testing): final step in which potential users try the
program and provide feedback.
STEP 5: PROGRAM DOCUMENTATION
Documentation consist of written description
and procedures about a program and how to
Program documentation is carried on
throughout all the programming steps
People who use documentation
who need to know how to use the program
some organizations offer training courses
other expect users to learn from written documentation
who need to know how to execute the program and how to recognize
and correct errors
who may need to update and maintain the program in the future
documentation could include text and program flowchart ,program
listings and sample outputs
STEP 6 : PROGRAM MAINTENANCE
Design to ensure that the program operates correctly, efficiently and
Two categories of maintenance activities are the following
-include locating and correcting errors, improving usability and
-organizations change over time and their programs must change
starts with core program functionality, then
expands until the customer is satisfied with the results.
CASE and OOP
Computer-aided software engineering(CASE) tools provide
automation and assistance in program design ,coding and
Traditional systems development focuses on procedure to
complete a specific objective.
Object-oriented software development focuses less on
procedures and more on defining relationships between
previously defined procedures or objects.
Object-oriented programming (OOP)- a process by which a
program is divided into modules called objects
Each object contains both the data and processing operations
necessary to perform a task.
Programming languages have
levels or generations ranging
from low to high.
1.Lower-level languages are
closer to the 0s and 1s
language of computers.
2.Higher-level languages are
closer to the languages of
High-level procedural languages
If (score> = 90)grade = ‘A’;
SELECT client FROM dailyLog WHERE
serviceEnd > 17
Problems and constraints languages
Get patientDiagnosis from
patientSymptoms “sneezing”, “coughing”,
Computer programmers create, test, and
They also update and repair existing programs
Requirements include a bachelor’s or specialized
two-year degree in computer science or
Salary range is $51,500 to $88,000