COM - 113 - INTRO. Basic Program
COM - 113 - INTRO. Basic Program
INTRODUCTION TO PROGRAMMING
1a. Define a computer program
Answer
Computer program is a series of step by step instruction that provides solution to a particular
problem and direct the computer on what to do exactly, though a program is a set of instructions, but
the statement must be submitted to a computer as a unit to direct the computers behavior.
Answer
i.System programming
1. System program are designed to facilitate the use of the hardware and to make the computer
system function efficiently and run quickly.
2. Application programming: This system is designed to solve a particular problem e.g. word
processing software, database application, desktop publishing application, web publishing
software, graphic tool etc.
2a. List and explain features of good program.
Answer
The features are as follows:
i. Reliability
ii. Maintainability
iii. Portability
iv. Readability
v. Performance
1. Reliability: By reliability, we mean that you should be able to depend on the program to
always do what it has being designed to do.
2. Maintainability: By this, we mean that you should be able to modify the program when the
need arises
3. Portability: the concept of portability in programming is that a program should be of being
transferable to a different computer platform with a minimum modification if at all
4. readability: A program should be easy for programmers to read and understand e.g.
readable program is easier to maintain.
5.Performance: A program that doesn’t carry out the expected task quickly and efficiently has
lost the performance aim. The aim is in designing a program. The program should execute
quickly and efficiently.
2b. What is High-level language?
Answer
High level language are machine independent. high level language is either procedure
oriented or problem oriented. high level language can also be classified as
i. Scientific oriented language
ii. Business oriented language
iii. Multi-purpose language
iv. Educational oriented langualges
v. Natural language
3a. What is Algorithm?
Answer
Algorithm is defined as a step by step procedure or solution to a given problem or task. in another
hand you can define algorithm as a prescribed set of idea, defined rules or instructions for the solution
of a problemina finite number of steps.
3b. Write algorithm to calculate the average of five numbers and translate it into a Pascal code
Answer
Algorithm to calculate the average of four number
Algorithm average
Declare
A, b , c , d , e , f Real
Execute
Input a, b , c ,d , e ,f ?
(a+b+c+d+e)/5
Output “f”=c,c
End average
Pascal code
Program.Average (input,output)
Var a, b ,c , d, e, f real
Begin
Read (a,b,c,d,e).
F=(a+b+C+d+e)/2;
Writef=;f;
End.
Oval Start/Stop
Rectangle Process
Diamond Decision
Parallelogram Input/output