CHAPTER 8
COMPUTER PROGRAM
Introduction
• Computer can perform a variety of tasks like receiving data, processing it and producing
useful results.
• Computer need to be instructed to perform even a simple task like addition of two
numbers
• Computer work on a set of instructions called computer program
Introduction
• Computer program: specifies a way to carry out a task
• Computer Programmer: responsible for designing, writing, and modifying computer
programs
1. System Programmer: write programs, which provides interface and functionality to the
hardware programs
2. Application Programmer: writes programs to fulfil a specific task such as payroll system,
inventory control
Developing a Program
• Program consists of a series of instructions that a computer processes to perform the
required operation
• Programmer should specifies:
1. The instruction to be performed
2. The order in which those instructions are to be performed
3. The data required to perform those instructions
A,B C = A+B C
Input Processing Output
Program Development Cycle
• Before writing a program (coding), the programmer has to determine the problem that
needs to be solved
• One common approach to problem solving is to use program development cycle
Problem
Analysis
Maintenan
ce and Task
Enhancem Analysis
ent
Algorithm
Implement
Developm
ation
ent
Document Algorithm
ation Testing
Testing
and Coding
Debugging
Program Development Cycle
• Problem Analysis:
◦ Problem is analyzed precisely and completely
◦ Developer knows about the scope within the problem needs to developed
• Task Analysis:
◦ Developer needs to develop various solutions to solve the given problem
◦ From numerous solutions, optimum solution is chosen
Program Development Cycle
• Algorithm Development:
◦ An algorithm (ex. flowchart) is developed to depict the basic logic of the selected solution
◦ Algorithm depicts the solution in logical steps
• Algorithm Testing:
◦ Before converting the algorithm into actual code, it should be checked for accuracy
◦ Test data need to be ‘walk through’ each step in the algorithm
◦ That verify that the instructions described in the algorithm actually perform the required
functions or not
◦ Identify major logical errors, if any
◦ Ensure that algorithm work for both normal and unusual data
Program Development Cycle
• Coding:
◦ Program takes place in the chosen programing language
• Testing and Debugging:
◦ Find logical errors (semantic errors) or due to the incorrect use of programming language (syntax
error)
◦ Results obtained are compared with results calculated manually from the test data
◦ Depend upon the complexity, several rounds of testing may be required
Program Development Cycle
• Documentation:
◦ Once the program is free from the errors, it is the duty of programmer developer to ensure that
program us supported by suitable documentation
◦ Documentation enables the user to operate the program correctly
• Implementation:
◦ The program is installed on the end user’s machine
◦ The implementation can be viewed as the final testing because only after using the program, the
user can point out the drawbacks and report them to developers
• Maintenance and Enhancement:
◦ Program should properly maintained by taking care of the changing requirements of its users and
system