f3 Comp Updated Notes
f3 Comp Updated Notes
UPDATED NOTES
Page 1 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Page 2 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
COMPUTER
FORM 3 SIMPLIFIED NOTES
Note. A good system should have features of both soft & hard systems, e.g., a stock management
system should be able to show when the demand for a certain item rises so that a decision can be
made on when to buy more stock. Similarly, new demand is driven by soft aspects in people’s lives
such as attitude & seasons.
2). Purpose
A system must be designed to achieve a specific predetermined objective, e.g., one main objective of a
school system is to enable the students to excel in national examinations.
The objectives that a system is supposed to achieve will enable the system developers measure the
performance of the system during its operation.
4). Sub-systems
Each system is made up of different components (or other systems) that communicate with each
other. These systems are described as Sub-systems.This means that, a system does not exist
alone, but it is composed of subsystems, which are also made up of other subsystems.
Example;
The Classroom system is part of a School system, which is a subsystem of the Ministry of
Education. The Ministry of Education is part of the Government, while the Government is part of the
Global system.
Therefore, every system is a component of a larger system.
6). Process
A system will usually transform data from one state to another.
Usually, after the raw data is collected & prepared into a form suitable for input, it is then
manipulated into information using the given procedures or instructions. The processing may be
manual, clerical, electro-mechanical or automatic to obtain the information.
Page 5 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
The figure below shows a system that has feedback to the control function.
Example;
A motor vehicle manufacturing company is expected to produce several vehicles per day. If the
demand increases, the feedback will show that the company is underperforming.
Control signals can then be issued to speed up the movement of units on the Assembly line so as
to increase production.
Open systems:
An Open system is that which interacts and communicates with its environment constantly. It
receives inputs from & gives output to the environment.
Examples of open systems;
Business organizations.
Information systems.
- Open systems normally adapt to changes in the environment, e.g., for any business
organization to exist, it must be able to adapt to the changing market prices, competition, etc.
- An open system has an unlimited scope when providing the services of the organization.
- In an open system, relevant variables keep on interacting.
- An open system is generally flexible & abstract.
Closed systems:
A Closed system is that which does not interact or communicate with its environment. It does not
communicate to or receive communication from its environment.
- Closed systems do not receive inputs or give output to their environment.
Page 6 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
- A closed system can correct or control itself; hence, it does not obtain modification from its
environment.
- A closed system has a limited scope when providing the services of the organization.
- The variables in a closed system are self-contained.
- A closed system is rigid & mathematical.
Revision Questions.
1. What do you mean by a System?
2. Differentiate between soft systems and hard systems.
3. List five characteristics of a system.
4. Explain the term system boundary.
a). What is system Control?
b). Why do we need feedback in a system?
c). Draw a well-labelled diagram that shows a system that is controlled through feedback.
5. Distinguish between open and closed systems.
Page 7 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
TOPIC: 2 INFORMATION SYSTEMS
Definition of an Information system:
An Information system is an arrangement of people, data processes & information that work together
to support and improve the day-to-day operations in a business and the decision- making process.
Generally, the Information system of an organization is the complete apparatus for handling all aspects
of information within an organization. It includes people, procedures, technological, and other
resources that collect, transform & disseminate information in the organization.
System Analysis:
System analysis is the process of examining an activity, procedure, technique or organization to
determine what must be accomplished and how best the operations may be accomplished in order
to achieve the predetermined objectives.
The process of collecting & analyzing facts that relate to an existing situation, diagnosing
problems, and using the facts gathered to design & implement an effective computerized system.
Page 8 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
System Design:
System design is the activity that involves identifying possible solutions to a problem, and then deciding
on the most appropriate system to solve the problem.
System design is concerned with the design of a computerized application based on the facts
disclosed during the Analysis stage.
In system design, the nature & contents of inputs, files & outputs are formulated and described in order
to show how they are connected by processing procedures, and for the purpose of developing a new
(or, an improved) system.
Revision Questions.
1. Define the following terms: i). Information system.
ii). Online analytical processing.
2. State and explain three purposes of Information systems in organizations.
3. Highlight three circumstances that necessitate the development of new information systems.
4. List down four roles of an Information system analyst.
Traditional approach.
In the Traditional approach, there is no formal documented methodology to be followed by all system
developers in the organization.
Page 9 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
The method relies mostly on the skills & experience of the individual members carrying out the project
development.
Advantage of RAD.
Ensures faster development of information systems, and as a result, increase production of an
organization.
Disadvantage of RAD.
- The working system may be weak due to quick development, i.e., a system may be working well but
may not have the necessary inbuilt security mechanisms.
Page 10 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
requirements by designing system interfaces in the presence of the user.
Structured approach
In structured approach, there is a defined set of stages that should be followed when developing a
system. Each stage is well documented and specifies the activities to be carried out by the system
analyst and his team while developing a system.
Revision Questions.
1. Explain three system development theories and methods.
2. (a) State one disadvantage of the Traditional approach in system development.
(b) State the main advantage of Rapid Application Development method.
The stages of developing a system are called the System development life cycle (SDLC). The 7 main
stages in system development include:
1. Problem recognition and definition.
2. Information gathering.
3. Requirements specification.
4. System design.
5. System construction (coding).
6. System testing and implementation.
7. System review and maintenance.
The following diagram represents the 7 stages, which must be followed in the system development
life cycle: -
Problem recognition
Problem recognition is done during the Preliminary investigation. A preliminary investigation
is carried to find out if really there is need for change.
During the problem recognition stage, the system analyst seeks to answer two questions:
1. Is the proposed project worth looking at?
2. Is the project worth pursuing?
After this, the system analyst then defines the scope of the project and tries to establish the limitations
(risks involved), the budget (i.e., cost, resources/manpower involved) & time involved.
Some of the most common limitations are:
- Lack of finance, and lack of appropriate technology (expertise) to develop the system.
Page 12 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
effective by comparing all the costs & benefits of the proposed system.
I.e., it tries to find out whether the expected benefits will exceed the costs of developing & operating
the proposed system.
3). Operational feasibility.
Operational feasibility is concerned with the operation of the office. It establishes whether the
management, employees, customers, suppliers & other users are happy, willing and able to
operate, use and support the proposed new system.
For example;
When carrying out operational feasibility study, the analyst tries to:
Ask the users whether they accept the new system?
Find out whether the staff has the necessary skills or manpower? If they don’t have the
necessary skills, how are they going to acquire them? Do they require training or not?
Look at the kind of job assignments that will be affected.
Look at how the firm will be reorganized to accommodate the new system, e.g., office space,
comfort, etc.
Page 13 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
TOPIC 3: DATA PROCESSING
Data processing deals with how data is organized & processed in the computer. DATA:
Data is a collection of facts & figures, which can be processed to produce information.
Examples:
In an educational environment, when students sit for exams, the grades obtained represent the data to
be processed by the computer. In this case, data can be Names of students & Marks obtained.
In a business environment, data can be the No. of Hours worked, names of employees, Stock
Data can also be described as Raw data, if they are not yet processed, i.e. if they do not convey
particular meaning to a given activity within any given environment.
It therefore means that, Data are unprocessed information consisting of details relating to business
transactions. For example, in a Payroll system, data are employee’s names, basic salary, department
number, marital status, etc.
DATA PROCESSING:
The collection, manipulation & distribution of data (i.e.) letters, numbers & graphic symbols, to achieve
certain objectives.
The processing may involve calculations, comparisons, decision-making and/or any other logic to
produce the required result.
The activity of manipulating the raw facts to generate a set of meaningful data (described as
Information), which is able to convey some meaning.
Those activities, which are concerned with the systematic recording, arranging, filing, processing, and
dissemination of facts relating to the physical events occurring in a business.
Data processing is a very important activity in any organization of any size or nature because it
generates information for decision-making.
If the data processing uses complicated processing tools or aids, e.g. the computer, it is described as
Electronic Data Processing (EDP).
Page 14 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
INFORMATION.
Information is data, which is summarized and processed in the way you want it, so that it is useful in
your work.
Information is an assembly of meaningful data items.
The information in Payroll activity includes; Net pay, Total Tax deductions, etc. In Stock Control, the
information generated includes; Closing stock, Total cost of the items, Purchases, Sales, etc.
The information is obtained by applying some processing procedures onto the raw data being input.
For example, to get the Net pay in a Payroll activity, the procedure would be;
Net pay = (Basic salary + Allowances + Overtime, if any) – Taxes.
Information is the end product of data processing available at the right place, the right time and in the
right form.
The information generated by the data processing activities is very important in the working strategies
of any organization, because it is used by the organization to make decisions.
In a Manufacturing industry, data may be compared to raw materials and Information to finished
products. Just as raw materials are transformed into finished products, raw data are transformed into
information.
In order to generate information from data items, a set of processing activities have to be performed on
the data items in a specific sequence depending on the desired final result. Performing these processes
is known as Data processing.
User
Page 15 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Exercise.
Define the terms: Data.
Information. Data processing.
Distinguish between the following terms: Data.
Data processing. Information
Using examples, explain the difference between ‘Data’ and ‘Information’.
Data processing cycle refers to the various stages involved in converting data into information.
There are 5 primary elements/functions of data processing system. They include; Input, Processing,
Storage, Output, and Control.
Exercise I.
DATA COLLECTION.
Data Collection is the process involved in getting the data from the point of its origin to the computer
in a form suitable for processing.
Note. Data collection starts at the source of the raw data & ends when valid data is within the computer
in a form ready for processing.
Data Entry:
Nowadays, most end-users input data to the computer using Keyboards on PCs, Workstations, or
Terminals.
Data can originate in many forms, but the computer can only accept it in a machine-sensible form.
Page 16 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Problems of Data Entry.
The data to be processed by the computer must be presented in a Machine-sensible form (i.e. in the
language of a particular input device).
Note that most of the data originates in a form that is not machine-sensible. Therefore, the data
must undergo the process of Transcription before it is suitable for input to the computer.
The process of Data collection involves getting the original data to the “processing center”, transcribing
it, sometimes converting it from one medium to another, and finally getting it into the computer. This
process involves a great number of people, many machines, and much expense.
Data Capture:
Data Capture is the process of obtaining data in a computer-sensible form at the point of origin.
Obtaining of data in a computer-sensible form helps to avoid many of the problems of data entry.
The captured data may be stored in some intermediate form for later entry into the main computer in the
required form. If data is input directly into the computer at its point of origin, the data entry is said to be
On-Line. In addition, if the method of direct input is a terminal or workstation, the method of input is
known as Direct Data Entry (DDE).
Page 17 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
TOPIC 3: DATA REPRESENTATION IN A COMPUTER.
Computers handle data by electrical components, e.g. Transistors, Semiconductors, Integrated Circuits
or wires, which exist in two conditions (states), ON & OFF or “1” & “0”.
Inside the computer, data is represented by storage cells, which are either electronically charged or
discharged.
Examples;
In RAM, the cells can be charged and discharged at will, and this can be used to store different data
items. The charged state of the cell can be represented by 1 (or ON), while the
uncharged state by 0 (or OFF).
In ROM, the cells are permanently set to one state.
A Transistor may be conducting or non-conducting.
A Magnetic material may be magnetized in one direction or the other. A wire may or may not be
carrying a current.
The Main memory of the computer can be considered as a collection of thousands of storage cells,
each capable of representing a binary digit.
DATA TYPES.
Data is a term used to describe a set of facts. A single fact is known as Datum. Data can be in 3 types
or forms.
Numeric data (numbers) Alphabetic data.
Alphanumeric data. Numbers:
Numbers can be expressed as either;
Note. A whole number is Real if it is written with a decimal point, e.g., 25 is an integer, but
25.0 is real.
Alphabetic data:
This is data made from combination of alphabetic characters, such as names, title, marital status, e.g.
“John”, “Prof.”, “Married”.
Page 18 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
A string is any sequence of characters.
This is data made from combination of alphabetic characters, numerals and/or special characters.
Examples;
Page 19 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
TOPIC 4: ELEMENTARY PROGRAMMING PRINCIPLES
Definition of terms
Computer Program:
A computer program is a set of coded instructions given to the computer, and represents a logical
solution to a problem. It directs a computer in performing various operations/tasks on the data
supplied to it.
Programming:
Programming is the process of designing a set of instructions (computer programs) which can be
used to perform a particular task or solve a specific problem.
It involves use of special characters, signs and symbols found in a particular programming language
to create computer instructions.
The program created must specify in detail the logical steps to be taken & the method of processing
the data input into the computer in order to carry out the specified task.
A computer program performs the following: Accepts data from outside the computer as its input.
Carries out a set of processes on the data within the computer memory.
Presents the results of this processing as its output, and Stores the data for future use.
Programming Languages:
Page 20 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
TERMS USED IN COMPUTER PROGRAMMING
Source program (source code)
The term Source program refers to program statements that the programmer enters in the program
editor window, and which have not yet been translated into machine-readable form.
Source code is the code understood by the programmer, and is usually written in high-level language
or Assembly language.
LANGUAGE TRANSLATORS
A computer uses & stores information in binary form, and therefore, it cannot understand programs
written in either high-level or low-level languages. This means that, any program code written in
Assembly language or high-level language must be translated into Machine language, before the
computer can recognize & run these programs.
A Translator is special system software used to convert the Source codes (program statements written in
any of the computer programming languages) to their Object codes (computer language equivalents).
The Translators reside in the main memory of the computer, and use the program code of the high-
level or Assembly language as input data, changes the codes, and gives the output program in
machine-readable code.
In addition, translators check for & identify some types of errors (e.g., Syntax/grammatical errors) that
may be present in the program being translated. They will produce error messages if there is a mistake
in the code.
Each language needs its own translator. Generally, there are 3 types of language translators:
Assembler.
Interpreter.
Compiler.
Note. Interpreters & Compilers translate source programs written in high-level languages to their
machine language equivalents.
Assembler
An assembler translates programs written in Assembly language into machine language that the
computer can understand and execute.
Page 21 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Functions of an Assembler.
It checks whether the instructions written are valid, and identifies any errors in the program.
The Assembler will display these errors as well as the complete source and object programs. If the
program has no errors, the job control will let it run immediately, or save the object program so that it
may run it later without translating it again.
It assigns memory locations to the names the programmer uses.
E.g., the Assembler keeps a table of these names so that if an instruction refers to it, the Assembler can
easily tell the location to which it was assigned.
It generates the machine code equivalent of the Assembly instructions.
Usually, the Assembler generates a machine code only when no errors are detected. Some of the errors
include;
Typing mistakes.
Using the wrong format for an instruction.
Specifying a memory location outside the range 0 – 2047.
Note. The Assembler cannot detect Logic errors. The programmer knows of these errors only when
the program is run & the results produced are incorrect (not what the programmer expected). The
programmer must therefore, go through the program & try to discover why an incorrect result was
being produced.
Interpreter
An interpreter translates a source program word by word or line by line. This allows the CPU to
execute one line at a time.
The Interpreter takes one line of the source program, translates it into a machine instruction, and then it
is immediately executed by the CPU. It then takes the next instruction, translates it into a machine
instruction, and then the CPU executes it, and so on.
The translated line is not stored in the computer memory. Therefore, every time the program is needed
for execution, it has to be translated.
Compiler
A compiler translates the entire/whole source program into object code at once, and then executes it in
machine language code. These machine code instructions can then be run on the computer to perform
the particular task as specified in the high-level program.
The process of translating a program written in a high-level source language into machine
language using a compiler is called Compilation.
For a given machine, each language requires its own Compiler. E.g., for a computer to be able
translate a program written in FORTRAN into machine language; the program must pass through the
Page 22 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
FORTRAN compiler (which must ‘know’ FORTRAN as well as the Machine language of the
computer).
The object code file can be made into a fully executable program by carrying out a Linking process,
which joins the object code to all the other files that are needed for the execution of the program. After
the linking process, an executable file with an .EXE extension is generated. This file is stored on a
storage media.
Points to note.
The job of a Compiler is much more difficult than that of an Assembler in that, a single statement in a
high-level language is equivalent to many machine instructions.
The format of an Assembly instruction is fairly fixed, while high-level languages give a lot of freedom
in the way the programmer writes statements.
Functions of a compiler.
A Compiler performs the following tasks during the compilation process:
It identifies the proper order of processing, so as to execute the process as fast as possible &
minimize the storage space required in memory.
It allocates space in memory for the storage locations defined in the program to be executed. It reads
each line of the source program & converts it into machine language.
It checks for Syntax errors in a program (i.e., statements which do not conform to the grammatical
rules of the language). If there are no syntax errors, it generates machine code equivalent to the given
program.
It combines the program (machine) code generated with the appropriate subroutines from the library.
It produces a listing of the program, indicating errors, if any. Differences between Compilers and
Interpreters
Interpreter Compiler
Translates & executes each statement of the Translates all the source code statements at
source code one at a time. once as a unit into their corresponding object
codes, before the computer can execute them.
The source code instruction is translated &
immediately obeyed by the computer hardware A Compiler translates the entire source
before the next instruction can be translated. program first to machine code, and then the
(Translation & execution go together). code is executed by the CPU.
(Translation & execution are separate
phases) needed for execution; hence, it is slower than compiling.
Translates the program each time it is
Page 23 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Interpreted object codes take less memory Compiled programs (object codes) can be saved on a
compared to compiled programs. storage media and run when required; hence executes
faster than interpreted programs.
For an Interpreter, the syntax (grammatical)
errors are reported & corrected before the Compiled programs require more memory as their object
execution can continue. files are larger.
An Interpreter can relate error messages to For a Compiler, the syntax errors are reported & corrected
the source program, which is always after the source code has been translated to its object code
available to the Interpreter. This makes equivalent.
debugging of a program easier when using
an Interpreter than a Compiler. Once the source program has been translated, it is no
longer available to the Compiler, so the error messages
are usually less meaningful.
Page 24 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
To generate bug-free codes from high-level expressions of requirements.
The 5GL’s are designed to make a computer solve a problem by portraying human-like intelligence.
The languages are able to make a computer solve a problem for the programmer; hence, he/she does
not spend a lot of time in coming up with the solution. The programmer only
thinks about what problem needs to be solved and what conditions need to be met without worrying
about how to implement an algorithm to solve the problem.
It is designed for use with Expert systems & Artificial Intelligence. It is mostly used for solving
problems, which involve objects and relationships between objects.
Page 25 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
OBJECT-ORIENTED PROGRAMMING LANGUAGES (OOPs)
OOPs use objects. An Object is a representation of a software entity such as a user-defined window
or variable. Each object has specific data values that are unique to it (called state) and a set of the
things it can accomplish called (functions or behaviour).
Several objects can be linked together to form a complete program. Programs send messages to an
object to perform a procedure that is already embedded in it. This process of having data and
functions that operate on the data within an object is called encapsulation.
The data structure & behaviour of an object is specified/described by a template (called a class).
Classes are hierarchical, and it is possible to pass the data & behaviour of an object in one class down
the hierarchy.
Object-Oriented programming enables rapid program development. Every object has properties such
as colour, size, data source, etc, which can be set easily without much effort. In addition, every object
has events associated with it that can be used to trigger certain actions, e.g. remove the window from
the screen on clicking the ‘Close’ button.
OOP has contributed greatly to the development of graphical user interface operating systems
and application programs.
Examples of Object-oriented programming languages are: -
Simula C++
SmallTalk Java
Java is sometimes associated with development of websites, but it can be used to create whole
application programs that do not need a web browser to run.
JAVA
Java is an OOP language that resembles Object C (a simplified form of C++).
The code of Java displays graphics, accesses the network, and interfaces with users via a set of
capabilities known as classes. Classes define similar states & common methods for the behavior of
an object.
JAVA programs are not compiled into machine code; instead, they are converted into a collection of
bytes that represent the code for an abstract Java Virtual machine (VM). A Java interpreter running on
a physical machine is then used to translate those bytes into local actions, such as printing a string or
Page 26 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
drawing a button.
Web scripting languages are mostly used to create or add functionalities on web pages.
Web pages are used for creating Web sites on the Internet where all sorts of advertising can be done.
Web pages are hypertext (plain-text) documents written using a language called HyperText Markup
Language (HTML). HTML documents have a file extension of .Html or .Htm.
Note. HTML doesn’t have the declaration part and control structures, and has many limitations.
Therefore, to develop functional websites, it must be used together with other web scripting languages
like JavaScript, VBScript and Hypertext Preprocessor.
Page 27 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
computer understands it equivalents the source code at once into
directly). object code; Interpreter
Executed by the hardware Executed faster than High- translates line byline.
directly & is faster. level, but slower than the Translation & execution is very
machine code programs. slow.
Development time
Development time is the time a programmer takes to write and run a program.
High-level languages are easy to read, understand and develop; hence, they require less development
time. Machine code & Assembly languages are relatively difficult to read,
understand and develop; hence, they are time-consuming.
Page 28 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Popularity
The language selected should be suitable and/or successful in the market with respect to the problems
to be solved.
Documentation
It should have accompanying documentation (descriptions) on how to use the language or maintain
the programs written in the language.
Maintenance
Programs are developed to solve specific problems, and the problems keep on changing; hence, the
programs are also changed to perform the new functions.
Program maintenance is the activity of incorporating more routines onto the program, modifying the
existing routines or removing the obsolete routines to make the program adapt to a functionally
enhanced environment.
The maintenance is made easier if the language used is easy to read and understand.
Review Questions
Page 29 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
PROGRAM DEVELOPMENT.
Problem recognition.
The programmer must know what problem he/she is trying to solve. He/she must also understand
clearly the nature of the problem & the function of the program.
In order to understand a problem, look for the keywords such as compute, evaluate, compare, etc.
Usually, a programmer identifies problems in the environment and tries to solve them by writing a
computer program.
There are 3 situations that cause the programmer to identify a problem that is worth solving:
Problems or undesirable situations that prevent an individual or organizations from achieving their
purpose.
A new directive given by the management requiring a change in the current system.
Sample problem: Develop a program that can be used to calculate/find the area of a circle. Use the
equation A = π * r2.
The programmer should write a narrative on what the program will do, and how it is meant to
Page 30 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
achieve the intended purpose. Within this narrative, he/she is required to determine what data is to be
input & what information is to be output.
For example:
In calculating the area of any circle, the parameters needed to determine the area of any circle are:
Note. Problem definition should be done thoroughly to ensure user satisfaction, and to facilitate the
subsequent stages in the program development cycle. A failure at this stage usually results in a
system that will not work as intended, or that may not work at all.
Program design
Program design is the actual development of the program’s process or problem solving logic called
the Algorithm.
It involves identifying the processing tasks required to be carried out in order to solve the problem.
The design stage enables the programmer to come up with a model of the expected program (or a
general framework (outline) of how to solve the problem, and where possible, break it into a
sequence of small & simple steps.
The models show the flow of events throughout the entire program from the time data is input to the
time the program gives out the expected information.
The processing tasks must be in order & systematic. Therefore, the programmer identifies the
processing tasks required, and the exact order in which they are to be carried out.
The design process does not take account of the programming language to be used in the final
product, since it only defines program logic.
Page 31 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Note. It is important to design programs before entering them into the computer. The programmer
should only attempt to covert a design into a program code after ensuring that it is logically correct.
If possible, check the logical order on the desk.
Some programmers produce rough & ready solutions at a Keyboard, and continue to amend the
programs until eventually the program appears to do what was expected. This is not recommended
in programming because of the following reasons:
The final code may not be easy to follow, since it was just cobbled together. Variable names &
specific items of code may not be documented.
Programs produced by continuous amendments & changing of codes mostly lead to unforeseen
side effects.
E.g., there may not have been plan for testing the program or procedures, hence, the program may
easily fail.
A programmer may be asked to modify the code at a later date. Without sufficient documentation,
the programmer will be forced to trace through the program in order to gain an insight into how the
program functions.
Modular programming
Many programs are non-monolithic (i.e., they are not usually made up of one large block of code).
Instead, they are made up of several units called modules, that work together to form the whole
program with each module performing a specific task.
This approach makes a program flexible, easier to read, and carry out error correction.
Program coding
Program coding is the actual process of converting a design model into its equivalent program.
Coding requires the programmer to convert the design specification (algorithm) into actual
computer instructions using a particular programming language.
For example;
The programmer may be required to write the program code either in Pascal, C++, Visual Basic or
Java, and develop (invent) suitable identifiers, variable names, & their data types. However,
remember that, at this stage the coding is still a Pencil & paper exercise.
The end result of this stage is a source program that can be translated into machine readable form
for the computer to execute and solve the target problem.
Page 32 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Rules followed in coding a program.
Use the standard identifiers or reserved words.
Make the program more readable by using meaningful identifiers. Don’t use similar variables.
Keep spellings as normal as possible.
Use comments to explain variables & procedures. This makes the program readable. Avoid tricks
– write the program using straightforward codes that people can readily understand.
Modularize your program.
Sample programs written in Pascal language.
Example 1:
Develop a program code that would be used to solve the equation of a straight line given by the
expression: Y = mx + c
Program StraighLine (input, output); VAR
y, m, x, c: INTEGER;
BEGIN
Writeln (‘Input the value of M’); Readln (M);
Writeln (‘Input the value of X’); Readln (X);
Writeln (‘Input the value of C’); Readln (C);
Y: = (m * x) +c;
Writeln (‘The value of y is:’, Y);
Page 33 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
y, m, x, c: INTEGER; Four variables of type Integer have been
declared. This means that, the memory spaces that will
be set aside can only hold values that are whole numbers.
BEGIN The Begin statement marks the start of the
program body. Statements in this section are executed
by the computer. E.g., execution
Page 34 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
starts by asking the user to input the value of m.
Writeln (‘Input the value of M’); The Writeln statement displays whatever is
between the inverted commas in the brackets. The statements
will be sent to the screen exactly the way they appear in the
brackets.
This is because; the inverted commas are meant to make the
output readable on the screen.
To display the value held in a variable on the screen, remove
the inverted commas and write the name of the variable in the
brackets, e.g., Writeln (y) will display the value held in the
variable y.
Readln (M); The Read or Readln statement reads a value
and stores it in a variable.
When the program is running, a Read/Readln statement in
the code will displays blinking cursor that indicates to the
user where to type the input.
Y: = (m * x) +c; Calculates the value of y. in Pascal, the symbol ‘: =’ is called
the Assignment statement.
The values on the right are calculated then the answer stored
in the variable y which is on the left of the assignment
symbol.
Writeln (‘The value of y is:’, Y); The Writeln displays the value held in the
variable y on the screen.
Note. Y is not within the inverted commas.
END. The ‘END.’ statement shows the end of a
program.
Example 2:
Page 35 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Pascal code Explanation
Program AreaCircle (input, output); The Header of the program.
The statements in ( ) shows that the user inputs
data via Keyboard and the program display
information on the Screen.
CONST A constant has been declared with a name Pi and
Pi = 3.142; value 3.142.
VAR Variables with fractional parts have been declared.
Radius, Area: REAL;
BEGIN Marks the beginning of the program body.
Writeln (‘Enter the radius’); Displays on the screen the string between the
inverted commas.
Readln (Radius); Displays a blinking cursor that tells the user that an
input is needed before the program can continue.
Revision Questions.
State the rules followed in coding a program.
After designing & coding, the program has to be tested to verify that it is correct, and any errors
detected removed (debugged).
TESTING:
Testing is the process of running computer software to detect/find any errors (or bugs) in the program
that might have gone unnoticed.
During program testing, the following details should be checked; The reports generated by the system.
The files maintained in connection to the system’s information requirements. The input to the system.
The processing tasks.
The controls incorporated within the system.
Note. The testing process is a continuous process, and it ends only when the Programmer & the other
personnel involved are satisfied that when operational, the program will meet the objectives and the
growing demands of the organization.
Page 36 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Types of program errors
There are 5 main types of errors that can be encountered when testing a program. These are: Syntax
errors.
Run-time (Execution) errors.
Logical (arithmetic) errors. Semantic errors.
Lexicon errors.
Syntax errors
Every programming language has a well-defined set of rules concerning formal spellings,
punctuations, naming of variables, etc. The instructions are accepted only in a specified form
& and must be obeyed by the programmer.
Syntax errors are therefore, programming errors/mistakes that occur if the grammatical rules of a
particular language are not used correctly.
Examples:
Punctuation mistakes, i.e., if the programmer does not use the right punctuations & spaces needed by
the translator program, e.g., omitting a comma or a semicolon.
Improper naming of variables.
Wrong spellings of user defined and reserved words.
Reserved words are those words that have a special meaning to the programming language, and
should not be used by the programmer for anything else.
Syntax errors are committed by the programmer when developing, or transcribing the program, and
can be detected by the language translators, such as the Compiler as it attempts to translate a program.
Such errors must be corrected by the programmer before the program runs.
Logical errors relate to the logic of processing followed in the program to get the desired results. E.g.,
they may occur as a result of misuse of logical operators.
Logical errors cannot be detected by the translator. The programmer will detect them when the
program results are produced.
The program will run, but give the wrong output or stop during execution.
Page 37 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Run-time (Execution) errors.
Run-time (execution) errors occur when the programmer introduces new features in the program,
which are not part of the translator’s standards.
To detect and eliminate Execution errors, a test run should be performed on the program after it has
been translated.
Semantic errors.
These are meaning errors. They occur when the programmer develops statements, which are not
projecting towards the desired goal. Such statements will create deviations from the desired
objectives.
Semantic errors are not detected by the computer. The programmer detects them when the program
results are produced.
Example;
In the 1st statement, if the selection is between 1500 & 2200, the computer will pick only 1500
& 2200, and the other values will not be touched.
In the 2nd statement, the computer will be able to pick all the values between 1500 & 2200 because of
the ‘AND’ operator.
Page 38 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Lexicon errors.
These are the errors, which occur as a result of misusing Reserved words (words reserved for a
particular language).
Revision Questions.
State the three types of errors that can be experienced in program testing, and how each can be
detected.
Syntax errors can be detected by the help of translators while logical errors are detected differently.
Explain FIVE methods which can be used to detect Logical errors.
DEBUGGING:
Most programming errors often remain undetected until an attempt is made to translate a program.
Debugging is therefore, the process of detecting, locating & correcting (removing, eliminating) all
errors (mistakes or bugs) that may exist in a computer program.
For the program to be assumed as correct, several testing needs to be conducted by the programmer to
ascertain/establish their validity.
There are several methods of testing a program for errors. These include: Dry running (Desk
checking).
Translator system checking.
Functional testing. Use of Test data.
Use of debugging utilities. Diagnostic procedures.
System test with actual data.
It involves going through the program while still on paper verifying & validating its possible results.
If the final results agree with the original test data used, the programmer can then type the program into
the computer and translate it.
Page 39 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Dry running helps the programmer to identify the program instructions, detect the most obvious syntax
and logical errors, & the possible output.
Dry running is much faster. This is because; it involves the use of human brain as the processor,
which has got a well inbuilt common sense.
This is a type of testing, which involves the computer & the translator programs.
After entering the program, it is checked using a translator to detect any syntax errors. The translator
can be a Compiler or an Interpreter, which goes through the set of instructions & produces a list of
errors, or a program/statement listing which is free from errors.
This type of testing is based upon examining the internal structure of a program & selecting test data,
which give rise to the alternative cases of control flow.
The accuracy of a program can be tested by inputting a set of values referred to as Test data.
The test data is designed to produce predictable output. There are 2 types of test data;
Real data (live data): - test data obtained from the real problem environment (practical applications).
The programmer invents simple test data, which he/she uses to carry out trial runs of the new program.
At each run, the programmer enters various data variations including data with
errors to test how the system will behave. For example, if the input required is of numeric type, the
programmer may enter alphabetic characters. The programmer will then compare the output produced
with the predicted (actual) output.
Notes.
Where possible, the program should be tested using the same test data that was used for desk
checking. More strict/rigid tests should be applied on the program in order to test the program to its
limits.
Only Logical errors & Semantic errors can be corrected by the programmer using test data.
A good program should not crash due to incorrect data entry but should inform the user about the
irregularity and request for the correct data to be entered.
Page 40 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Use of debugging utilities.
After the program has been entered in the program editor, debugging utilities which are built in the
computer can be run during translation to detect any syntax errors in the program.
The errors are corrected and the debugging process is repeated again to find out more errors, before
the program is executed.
Diagnostic procedures.
For complex programs, diagnostic procedures, such as Trace routines, may be used to find logical
errors.
A Trace prints out the results at each processing step to enable errors to be detected quickly.
This is whereby the new program is run in parallel with the existing system for a short time so that
results can be compared and adjustments made. In such cases, the system test is made using actual
data.
Review Questions.
IMPLEMENTATION
Implementation refers to the actual delivery, installation and putting of the new program into use.
The program is put into use after it is fully tested, well documented, and after training the staff who will
be involved in the running of the new program.
Once the program becomes operational, it should be maintained throughout its life, i.e., new routines
should be added, obsolete routines removed, & the existing routines adjusted so that the program may
adapt to enhanced functional environments.
Page 41 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
The main objective of maintenance is to keep the system functioning at an acceptable level. Program
maintenance mainly involves: -
Correcting errors that may be encountered after the program has been implemented or exposed to
extensive use.
Changing procedures.
Hardware and software maintenance.
Changing parameters and algorithms used to develop the original programs. Making any
adjustments as new technology comes.
Note. Program maintenance runs parallel to the maintenance of the program documentation, i.e., any
time maintenance is carried out on the program, the documentation should also be updated to convey
the right image of the system.
Program documentation.
After writing, testing, and debugging a program, it must be documented. In other words, the
programmer should describe all what he was doing during the program development stages.
Program documentation is the writing of supportive materials explaining how the program can be
used by users, installed by operators, or modified by other programmers.
Note. All the program development activities (i.e., from the initial stage up to the complete program)
should be documented/recorded in order to assist in the development of the program, future
modification of the program, general maintenance, machine & software conversion at a later date, and
program changeover.
Internal documentation is the writing of non-executable lines (comments) in the source program that
help other programmers to understand the code statements.
External documentation refers to reference materials such as user manuals printed as booklets.
User-oriented documentation.
This enables the user to learn how to use the program as quickly as possible, and with little help from
Page 42 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
the program developer.
Operator-oriented documentation:
This is meant for computer operators such as the technical staff. It is used to help them install &
maintain the program.
Programmer-oriented documentation:
This is a detailed documentation written for skilled programmers. It provides the necessary technical
information to help in future modification of the program.
Reference guide.
It is used by someone who already knows how to use the program but needs to be reminded about a
particular point or obtain more detailed information about a particular feature.
Technical manuals.
They are intended for System analysts & Programmers. They assist in maintaining & modifying the
program design and code.
DEVELOPING OF ALGORITHMS
After carefully analyzing the requirements specification, the programmer usually comes up with the
algorithm.
Definition of an Algorithm:
An Algorithm is a limited number of logical steps that a program follows in order to solve a problem.
A step-by-step (a set of) instructions which when followed will produce a solution to a given problem.
Pseudocodes. Flowcharts.
Decision Tables. Decision Trees.
Note. For any given problem, the programmer must choose which algorithm (method) is best suited
to solve it.
PSEUDOCODES.
A pseudocode is a method of documenting a program logic in which English-like statements are used
to describe the processing steps.
These are structured English-like phrases that indicate the program steps to be followed to solve a
given problem.
Page 44 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
The term “Code” usually refers to a computer program. This implies that, some of the words used in a
pseudocode may be drawn from a certain programming language and then mixed with English to
form structured statements that are easily understood by non-programmers, and also make a lot of
sense to programmers.
However, pseudocodes are not executable by a computer.
Example 1:
Write a pseudocode that can be used to prompt the user to enter two numbers, calculate the sum and
average of the two numbers and then display the output on the screen.
START
PRINT “Enter two numbers” INPUT X, Y
Sum = X + Y
Average = Sum/2 PRINT Sum
Page 45 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
PRINT Average
STOP
Example 2:
Write a structured algorithm that would prompt the user to enter the Length and Width of a rectangle,
calculate the Area and Perimeter, then display the result.
Solution
START
Set π to 3.14
Prompt the user for the Radius (R) Store the radius in a variable (R) Set Diameter to 2 *
Radius
Set Circumference to π * 2 * Radius Set Area to π * Sqr (Radius)
PRINT Diameter PRINT Circumference PRINT Area
STOP
Example 4:
Write a pseudocode for a program that would be used to solve equation: E = MC2.
START
Enter values from M to C E = M * C * C
Display E
STOP
It is important to use program control structures when writing Pseudocodes. The most common
constructs are:
Page 46 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Looping (Repetition / Iteration) – used where instructions are to be repeated under certain conditions.
Selection – used when choosing a specified group of instructions for execution. The group chosen
depends on certain conditions being satisfied.
Example 5:
Write a pseudocode for a program that can be used to classify people according to age. If a person is more
than 20 years; output “Adult” else output “Young person”.
START
PRINT “Enter the Age” INPUT Age
IF Age > 20 THEN
PRINT “Adult”
ELSE
PRINT “Young person”
STOP
Note. Pseudocodes make an algorithm easier to understand. This is because; the algorithm can be
read from top to bottom without the need for jumping backwards or forwards to follow the logic of the
algorithm as in flowcharts.
FLOWCHARTS.
A Flowchart is a diagrammatic or pictorial representation of a program’s algorithm.
It is a chart that demonstrates the logical sequence of events that must be performed to solve a
problem.
Types of Flowcharts.
Program flowchart.
This is a diagram that describes, in sequence, all the operations required to process data in a computer
program.
A program flowchart graphically represents the types of instructions contained in a computer program
as well as their sequence & logic.
Page 47 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
PROGRAM FLOWCHARTS.
A Flowchart is constructed using a set of special shapes (or symbols) that have specific meaning.
Symbols are used to represent operations, or data flow on a flowchart.
Each symbol contains information (short text) that describes what must be done at that point.
The symbols are joined by arrows to obtain a complete Flowchart. The arrows show the order in
which the instruction must be executed.
Below is a standard set of symbols used to draw program flowcharts as created by American National
Standard Institute (ANSI).
Terminal symbol.
It is used to indicate the point at which a flowchart, a process or an algorithm begins & ends.
All Flowcharts must have a START & STOP symbol. The START/BEGIN symbol is the first
symbol of a flowchart, & identifies the point at which the analysis of the flowchart should begin. The
STOP/END symbol is the last symbol of a flowchart, & indicates the end of the flowchart.
The words Begin & End (or Start & Stop) should be inserted in the Terminal symbol.
(Parallelogram)
Process symbol.
(Rectangle)
- Process symbol is used to indicate that a processing or data transformation is taking place.
The information placed within the process symbol may be an algebraic formula or a
sentence to describe processing.
Page 48 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
Processing defined as a Formula Processing defined as a Sentence
Decision symbol.
NO (Rhombus)
YES
- It is used to indicate/ specify a condition or to show the decision to be made. There are 2 main
components of a Decision symbol:
A question asked within the Decision symbol, that indicates the comparison / logical operation.
The results of the comparison (which are given in terms of YES or NO).
The arrows labeled YES or NO lead to the required action corresponding to the answer to the
question.
Flow lines.
Flow lines with arrowheads are used to indicate the direction of processing of the program logic, i.e.,
they show the order in which the instructions are to be executed.
The normal flow of a flowchart is from Top to Bottom, and Left to Right. Note. Flow lines should
never cross each other.
Connector symbol.
Sometimes, a flowchart becomes too long to fit in a single page, such that the flow lines start
crisscrossing at many places causing confusion & also making the flowchart difficult to
understand.
The Connector symbol is used as a connecting point for arrows coming from different directions.
A Connector symbol is represented by a Circle, and a letter or digit is placed within the circle to
indicate the link.
Note. Connectors do not represent any operation. They are used to connect two parts of a
flowchart, indicating that the flow of data is not broken.
Page 49 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
General guidelines for drawing a program flowchart.
A flowchart should have only one entry/starting point and one exit point (i.e., ensure that the flowchart
has a logical start and finish).
The flowchart should be clear, neat and easy to follow. Use the correct symbol at each stage in the
flowchart.
The flowchart should not be open to more than one interpretation.
Avoid overlapping the lines used to show the flow of logic as this can create confusion in the
flowchart.
Make comparison instructions simple, i.e., capable of YES/NO answers. The logical flow should be
clearly shown using arrows.
Note. A flowchart should flow from the Top to Bottom of a page, and from the Left to the Right.
Where necessary, use Connectors to reduce the number of flow lines.
Connectors are helpful when a flowchart is several pages long, and where several loops are
needed in the logic of the flowchart.
Notes.
A flowchart must have a Start and an end.
A flowchart is useful when the algorithm is short & the flowchart can fit conveniently on a single page.
If the flowchart is too large, it is recommended to use Pseudocodes for long & complicated program
Advantages of using Flowcharts.
Effective synthesis.
Flowcharts may be used as working models in the design of new programs and systems.
Program flowcharts serve as good program documentation, which is needed for the following
reasons:
If programs are modified in future, the flowcharts will direct the programmer on what was originally
Page 50 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
done.
When staff changes occur, the flowcharts may help new employees understand the existing
programs.
Flowcharts assist in program conversion when new hardware/software are acquired. Effective
coding.
Program flowcharts act as a guide during the program preparation stage. Instructions coded in a
programming language may be checked against the flowchart to ensure that no steps are
omitted.
Flowcharts facilitate the maintenance of operating programs. They help the programmer to
concentrate on the part of the information flow which is to be modified.
Flowcharts are complex, clumsy & become unclear, especially when the program logic is complex.
Reproduction of flowcharts is usually a problem, since the flowchart symbols cannot be typed. No
uniform practice is followed for drawing flowcharts as it is used as an aid to the program.
Sometimes, it becomes difficult to establish the link between various conditions, and the actions to be
taken upon a particular condition.
Revision Exercise.
Page 51 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes
PROBLEM SOLVING
Problem Identification (problem recognition).
Write a program which:
Requests the user to enter a temperature in oC. Calculates the corresponding temperature in oF.
Outputs the given temperature and the converted value.
Find out how to convert the given temperature. If the given temperature is in oC, then convert it to oF.
F = 32 + (9 oC/5)
The Keyboard will be used to enter the Centigrade temperature, and display the output on the Screen.
Write the instructions in such a way that they can be easily converted into a form which the computer
can follow.
Page 52 of 53
Prefer Calling Amobi Group of Examiners @ 0743 333 000 or 0706 851 439 for F1-F4 All Subjects Notes