Introduction To Computer Science
Introduction To Computer Science
LECTURER IN CHARGE:
MR O.S OGUNMAKINA
INTRODUCTION TO COMPUTER
Course Writer: Mr. Oluwatosin A. Godwin CPhT, RDN.
(Deputy Provost Academic)
Spring-Up College of Health Science and Technology,
Ondo City, Ondo State.
URL: [Link]
Printed: 2023
INTRODUCTION
The computer is fast becoming the universal machine of the twenty-first century. Early
computers were large in size and too expensive to be owned by individuals. Thus they were
confined to the laboratories and few research institutes. They could only be programmed
by computer engineers. The basic applications were confined to undertaking complex
calculations in science and engineering. Today, the computer is no longer confined to the
laboratory. Computers, and indeed, computing have become embedded in almost every
item we use. Computing is fast becoming ubiquitous. Its application transcends science,
engineering, communication, space science, aviation, financial institutions, social sciences,
humanities, the military, transportation, manufacturing, the extractive industries to mention
but a few.
Also, early computers were designed to accept numeric data, but over the years computers
have been developed to accept not only numeric data, but we also able to process
multimedia data – text, audio and video. The combination of computer technology and
communications technology gave birth to what is now widely known as Information and
Communication Technologies (ICT). ICT has changed the face of virtually all fields of
human endeavour, ranging from science to engineering, commerce and industry,
international trade, transportation, culture and tourism, education and research, among
others. Nowadays, literacy is not only measured by the ability to read and write, but also
includes computer literacy. The wave of globlisation which has been largely propelled by
the collapse of barriers of distance between nations and peoples in the world as a result of
ICT, makes it imperative for the modern man to have at least the basic knowledge of
computers. This course is meant to introduce students to the historical evolution of
computers, the basic components of computers, and some of its applications in society.
COURSE AIMS
The aim of this course is to provide students with the basic understanding of the computer
and its applications in everyday life.
COURSE OBJECTIVES
The specific objectives of this course are to:
• Provide basic understanding of the historical evolution of the computer, types of
computers and the classification of computers.
• Enable the students to understand the components of the computer – the hardware and
software.
• Help students to identify the different categories of computer software and their uses.
• Introduce students to computer programming with emphasis on the building blocks and
stages of programming and writing of computer programs using visual basic.
• Enable students to identify and appreciate the areas of application of computers in
society, thereby stimulating their thought to regard the computer as a tool for human use
rather than a master.
• Create awareness at the early stage of the study of computers about the potential threats
that computer viruses pose to the smooth operations of computers.
COURSE CONTENTS
Chapter 1 Basic Concepts
Chapter 2 Historical Overview of the Computer
Chapter 3 Classification of Computers
Chapter 4 Hardware Components (1)
Chapter 5 Auxiliary Equipment
Chapter 6 Computer Software
Chapter 7 Application of Computers in Education
Chapter 8 Application of Computers in Business and Industry
Chapter 9 Application of Computers in Government, Military, etc
Chapter 10 Computer Virus
CHAPTER ONE
BASIC CONCEPTS
The computer is fast becoming the universal machine of the 21st century. Early computers
were large in size and too expensive to be owned by individuals. Thus they were confined
to the laboratories and few research institutes. They could only be programmed by
computer engineers. The basic applications were confined to undertaking complex
calculations in science and engineering. Today, the computer is no longer confined to the
laboratory. Computers and, indeed, computing have become embedded in almost every
item we use. Computing is fast becoming ubiquitous. Its application transcends science,
engineering, communication, space science, aviation, financial institutions, social sciences,
humanities, the military, transportation, manufacturing, and extractive industries to
mention but a few. This unit presents the background information about computers.
Definitions
Computer: A computer is basically defined as a tool or machine used for processing data
to give required information. It is capable of:
• taking input data through the keyboard (input unit),
• storing the input data in a diskette, hard disk or other medium,
• processing it in the central processing unit (CPU) and
• giving out the result (output) on the screen or the Visual Display Unit (VDU).
Data: The term data refers to facts about a person, object or place, e.g. name, age,
complexion, school, class, height etc.
Information: This is referred to as processed data or a meaningful statement, e.g. net pay
of workers, examination results of students, list of successful candidates in an examination
or interview etc.
Characteristics of a Computer
• Speed: The computer can manipulate large data at incredible speed and response time
can be very fast.
• Accuracy: Its accuracy is very high and its consistency can be relied upon. Errors
committed in computing are mostly due to human rather than technological weakness.
There are in-built error detecting schemes in the computer.
• Storage: It has both internal and external storage facilities for holding data and
instructions. This capacity varies from one machine to the other. Memories are built up in
K (Kilo) modules where K=1024 memory locations.
• Automatic: Once a program is in the computer’s memory, it can run automatically each
time it is opened. The individual has little or no instruction to give again.
• Reliability: Being a machine, a computer does not suffer human traits of tiredness and
lack of concentration. It will perform the last job with the same speed and accuracy as the
first job every time even if ten million jobs are involved.
• Flexibility: It can perform any type of task once it can be reduced to logical steps.
Modern computers can be used to perform a variety of functions like on-line processing,
multiprogramming, real time processing etc.
Software
Computer software is the series of instructions that enable the computer to perform a task
or group of tasks. A program is made up of a group of instructions to perform a task. Series
of programs linked together make up software. Computer programs could be categorised
into system software, utility software, and application programs.
Computer Users
Computer users are the different categories of personnel that operate the computer. We
have expert users and casual users. The expert users could be further categorised into
computer engineers, computer programmers and computer operators.
INTRODUCTION
The computer as we know it today has evolved over the ages. An attempt is made in this
unit to present in chronological order the various landmarks and milestones in the
development of the computer. Based on the milestone achievement of each era, the
computer evolution is categorised into generations. The generational classification,
however, is not rigid as we may find one generation eating into the next.
Classification by Purpose
Depending on their flexibility in operation, computers are classified as either special
purpose or general purpose.
a. Special-Purpose Computers
A special purpose computer is one that is designed to solve a restricted class of problems.
Such computers may even be designed and built to handle only one job. In such machines,
the steps or operations that the computer follows may be built into the hardware. Most of
the computers used for military purposes fall into this class. Other examples of special
purpose computers include:
• Computers designed specifically to solve navigational problems.
• Computers designed for tracking airplanes or missiles
• Computers used for process control applications in industries such as oil refinery,
chemical manufacture, steel processing and power generation
• Computers used as robots in factories like vehicle assembly plants and glass industries.
General-Purpose Computers
General-purpose computers are computers designed to handle a wide range of problems.
Theoretically, a general-purpose computer can be adequate by means of some easily
alterable instructions to handle any problems that can be solved by computation. In
practice, however, there are limitations imposed by memory size, speed and the type of
input/output devices. Examples of areas where general purpose computers are employed
include the following:
• Payroll
• Banking
• Billing
• Sales analysis
• Cost accounting
• Manufacturing scheduling
• Inventory control
Microcomputers
Microcomputers, also known as single board computers, are the cheapest class of
computers. In the microcomputer, we do not have a Central Processing Unit (CPU) as we
have in the larger computers. Rather we have a microprocessor chip as the main data
processing unit. They are the cheapest and smallest, and can operate under normal office
conditions. Examples are IBM, APPLE, COMPAQ, Hewlett Packard (HP), Dell and
Toshiba, etc.
Mini Computers
Mini computers have memory capacity in the range ‘128- 256 Kbytes’ and are also not
expensive but reliable and smaller in size compare to mainframe. They were first
introduced in 1965; when DEC (Digital Equipment Corporation) built the PDP – [Link]
mini computers are WANG VS.
Mainframe Computers
The mainframe computers, often called number crunchers have memory capacity of the
order of ‘4 Kbytes’, and are very expensive. They can execute up to 100 MIPS (Meanwhile
Instructions per Second). They have large systems and are used by many people for a
variety of purposes.
CHAPTER FOUR
HARDWARE COMPONENTS
Your personal computer (PC) is really a collection of separate items working together as a
team, with you as the captain. Some of these components are essential; others simply make
working more pleasant or efficient. Adding extra items expands the variety of tasks you
can accomplish with your machine.
Key Lock
You can stop intruders from tampering with your PC by using the lock on the front panel.
Turning the key prevents the keyboard from working.
Turbo Button
Some PCs offer a choice of speeds at which they can run. A turbo switch is usually left so
the computer runs at its fastest speed.
Reset Button
If your PC “freezes” and won’t respond to any command, try starting it up again using the
reset button. Pressing the reset button loses all the work you have not saved in that session,
so use it only as a last resort.
Power On/Off
All PCs have main power switch on the system unit. Sometimes this control is placed on
the outside back panel.
Serial Ports
Serial ports often connect the PC to the modem or mouse. Most PCs are fitted with two
serial ports that may be labeled “S101” and “S102”, “Serial 1” and “Serial 2”, or “COM
1” and “COM 2”.
Sound Jacks
If you have a sound fitted inside your system unit, you will see a jack or jacks at the back.
These can be used to connect your PC to speakers, a microphone, or an external sound
source.
The Keyboard Port
The cable from your keyboard ends with a round connector, which plugs into the keyboard
port.
The Network Adapter
If an expansion card is fitted to link your PC with other PCs in your office you will see a
network connector at the back of the system unit.
The Monitor Port
A cable from your monitor plugs into this port and carries display information to the
monitor.
Bays for Expansion Cards
PCs are easily expanded, perhaps to provide modem, sound or faster graphics. You can
plug cards into expansion slots inside the PC. The end of an expansion card shows at the
back of your machine, allowing you to connect items.
The brain behind everything that happens in your PC is contained within the system unit.
Inside the unit are the impressive electronics that run programs, handle instructions, and
determine the results. Most of the more important items are described below.
The Battery
A small battery powers a clock to keep track of the time when the PC is turned off. It also
maintains low electricity to certain RAM chips that record which components are installed.
The Disk Drive Controller Card
This card controls the PC’s disk drive motors and transfers data. The serial and parallel
ports at the back of the card link internal PC components with external devices such as
mouse and printer.
The Display Adapter Card (Video Card)
All the information your computer will display is stored in its memory. To be useful, you
need to see the information. The display adapter card is the link between the PC’s memory
and the monitor.
Expansion Slots
These long narrow connectors allow you to plug in expansion cards (also known as adapter
cards), which offer extra options not available on a basic PC.
ROM Chips
Read-only memory (ROM) chips have data written on them during manufacturing that tells
the CPU what to do when the PC is switched on. The data is always there, even when you
switch the PC off.
RAM Chips
When a computer is switched on and is running a program, RAM (Random Access
Memory) is used for purposes such as holding the program and its data. But when the PC
is switched off, anything held in RAM is lost.
Empty RAM Chip Slots
These slots let you expand your computer’s memory by adding extra RAM chips or
modules. Some PCs work even faster because they come equipped with Cache Memory.
Cache memory consists of expensive and very fast memory chips that store the data or
instructions that the CPU will look at next. Cache memory can speed up work on your
computer enormously.
Intel CPUs
The earliest PCs were equipped with a CPU from Intel Corporation called the 8088. The
next generation of PCs used CPU known by the number “80286” and were called “PC/AT”
computers. Subsequently, PCs have been supplied with more and more powerful CPUs –
the 80386, the 80486, and the more recent and impressive of all, the Intel Pentium (I, II,
III, IV& M).
All these PC processors belong to a family called 80 x 86. In general, you can run the same
software on PCs containing different CPUs within this family. From the outside, the chips
look different only in sizes and number of pin-put inside. An 80486 has over one million
components to the 3,500 that were in the first 8088. Because of these differences, the
Blatest Pentiums runs over ten times faster.
CPU Speed
The speed of a CPU is measured in megahertz (MHz). A computer has a central clock that
keeps all the components in time with each other; one hertz is similar to a clock tick and
megahertz is equal to one million ticks per second. If your PC runs at 333 or 400MHz, the
central clock ticks 333 or 400 million times every second. As you might imagine, the faster
the clock ticks, the faster the computer runs.
Without the CPU, there would be no PC. Like all other hardware components, CPUs are
continually undergoing further development. You can see the explosive technological
development in data processing most clearly in the development of newer and faster CPUs.
The CPUs have for years doubled their performance about every 18 months and there are
no indications that this trend will stop.
When we now look at all the CPUs from a broader perspective, we can see that:
• The CPU history is closely tied to the companies IBM and, especially, Intel.
• The CPUs have their roots back to Intel's chip 4004 from 1971.
• The compatibility concept has been important throughout the
development.
Generations of CPUs
There are CPUs of many brand names (IBM, Texas, Cyrix, AMD), and often they make
models which overlap two generations. This can make it difficult to keep track of CPUs.
Here is an attempt to identify the various CPUs according to generations:
DISKS
Floppy Disks
Computers use disks to store information. Although there is a permanent hard disk that
lives inside the system unit, you can use floppy disks to store and move data easily from
one PC to another. Floppy disks come in two sizes, either 5¼ or 3½ inches in diameter.
The smaller disks are able to store more data and are also less easily damaged, because of
their thicker plastic cases. As both sizes can be either “high” or “low” capacity (or density),
there are four main varieties of disks available. High-capacity disks are more expensive,
but they can store much more information. Low-capacity disks are generally labeled
DS/DD, which stands for “double sided/double density”, while the highcapacity floppy
disks are labelled DS/HD (double sided/high-density).
Input Devices
1 The Computer Keyboard
A computer keyboard is identical to the conventional typewriter keyboard. However, it has
more keys than the typewriter keyboard. A computer keyboard can be a dummy type or
intelligent type. A computer keyboard is considered to be intelligent if, in addition to
performing the routine functions characteristic of a typewriter keyboard, it can initiate a
series of actions for a computer to carry out by mere pressing a key or combination of two
or more keys. Thus, an intelligent computer keyboard has a set of keys which, when one
of them is pressed, the computer can be made to carry out a specific function. For example,
the pressing of a key may cause the computer to display a menu list from which the user
may be prompted to select one.
The intelligent computer keyboard has four major divisions, namely: Function keys,
Alphanumeric keys, Numeric keys and Control keys. In addition to the four types of keys,
there are some special or important keys such as the following:
(a) Return or Enter key
(b) Escape key denoted by ESC
(c) Control key denoted by CTRL
(d) Alternate key denoted by ALT
(e) Delete key denoted by DEL
(f) Insert key denoted by INS
(g) Backspace key
(h) Shift key.
Function Keys
The effects of the functions keys are software package dependent. That is, they mean
different translations depending on which software package one is running on the
computer. The function keys are traditionally labeled F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11 and F12. The function keys are often arranged to the left of the main keyboard in
two columns or they are arranged in a row above the main keyboard. In most software
packages, the function key F1 is used to run the HELP program. Word perfect, for example,
uses F3 for HELP program and F1 to cancel the last command issued on the computer. The
function keys F7 and F12 are used to save a text and block a section of a text respectively
in word perfect. Function keys can be programmed to carry out the functions desired by a
programmer. For example the function key F10 may be programmed to display menus.
Thus, the operations of the function keys can be determined by the user or programmed by
the software package being used at any point in time.
Alphanumeric Keys
The Alphanumeric keys can be likened with the conventional typewriter keys. They contain
alphabetic characters, numeric characters and special characters such as comma, full stop,
open bracket, close bracket, asterisk, semicolon, colon, question mark, and so on. Usually,
each key carries a character at the lower part and another character at the upper part. The
SHIFT key is used to switch on or off the lower and upper characters by the programmer.
Other cursor control keys are Home, Page Up, Page Down, and End. These keys may be
part of the numeric keypad or separated from the numeric keypad. Moving the cursor
around on the screen is one of the most common tasks in an application program. In fact,
cursor movement is so important in an application such as word processing that it can
usually be accomplished by additional key-driven commands.
The Spacebar
The spacebar is the longest key found on most keyboards. It erases characters at the cursor
position or gives a blank space when pressed.
The Tab Key
The tab key moves the cursor by five spaces to the right when pressed. The number of
positions moved depends on the software or the Tab Set by the operator. The Tab is
normally pressed to insert paragraphs during typing. In some programs, when this key is
pressed in combination with shift the key, the same number of positions is moved
backwards.
The Print Screen Key (Prtsc)
When the print screen key is pressed in combination with the shift key, whatever in is on
the screen will be printed on a printer. The same effect can be achieved by pressing the key
alone on some keyboards.
Keeping Your Keyboard Clean and Working
Never spill liquids on your keyboard. Coffee, soda, and other beverage spills can ruin your
keyboard. Liquid spills on the keyboard have even been known to cause electrical damage
to the PC itself. With that in mind, though you may not stop drinking coffee around your
computer, you should at least get a spill-proof mug or keep the coffee on the other
side of the desk.
Another enemy of the keyboard is static electricity. Static electricity can have the same
damaging effect on your keyboard as does liquid. If your keyboard doesn't respond
properly after a strong static charge, you may just need to turn off the PC and turn it back
on to reset the keyboard. In some cases, however, the static discharge can zap the keyboard
and even parts of the PC. If you shuffle your feet across the carpet or your PC is in a room
with dry air, avoid touching the PC or the keyboard until you have touched something
metal to discharge any static electricity. If you don't have a metal desk or bookcase in your
work area, consider buying an anti-static mat and keeping it where you can touch it before
touching the PC.
Dust, dirt, food crumbs, and hair are other enemies of the keyboard. Try to avoid eating
over the keyboard and if your computer is in a dirty, dusty area, keep the keyboard covered
when not in use. Some dirt and dust is unavoidable. To keep the keyboard working well,
you should occasionally clean it.
2 The Mouse and Joystick
A mouse looks like the electrical clipper in a barber’s shop. It consists of a pointing device
very sensitive to movements. It has a roller ball and two or more buttons which can be
pressed to make a selection. By moving the mouse on a flat smooth surface and clicking
one or a combination of two buttons on its upper surface, a computer to which it is
connected can be sensitised and commanded to carry out some specific tasks.
A mouse can be used to draw diagrams on the computer screen more effectively and
efficiently than the computer keyboard. Generally, the keyboard and the mouse do
complement each other. For example, the mouse can be used to highlight an item in a menu
list while the keyboard Enter Key can be pressed to activate or evoke the command
associated with the highlighted item.
A mouse is the primary input device for modern computers that feature operating systems
with a graphical user interface, such as Windows 98 or Windows XP. While keyboards
obviously excel at entering text, numbers, and symbols, your mouse is the tool you'll use
to tell your computer what to do with all the data you've entered.
Joysticks are almost exclusively used with game software and help the user more
effectively control the actions of computer-simulated airplanes or arcade-style games.
All modern PC operating systems (Windows 98, Windows XP, and the Macintosh) rely on
an on-screen pointer to select and execute commands. A mouse is simply an input device
built to help the user control this on-screen pointer in as natural and efficient a manner as
possible.
The pointer on the screen mimics the movements of your mouse. As you move your mouse,
a ball encased in the bottom of your mouse rolls on the desk and in turn sends signals to
the computer as to which direction to move the pointer on the screen. Move the mouse side
to side, or up and down, and the on-screen pointer moves in a similar manner.
Once you have the mouse positioned to select the command or data you want to act on, you
use the mouse buttons to execute the command. The mouse controls the on-screen pointer
and lets you select program icons, manipulate property sheets, and access data.
Output Devices
1 Printers
A printer is the computer component that lets you create copies of the information stored
in your computer on paper. The printed material is often called the hard copy, to
differentiate it from the data stored on a disk, or held in the computer's memory.
There are three basic types of printers available for use with personal computers:
Laser Printers: These combine a magnetic roller with powdered ink called toner to
transfer high-quality characters or images onto a page.
Inkjet Printers: These have small nozzles that actually spray fast drying ink onto the page
to form characters or images. Inkjet printers spray a fine, quick-drying ink through small
nozzles to produce characters and images on paper. Although the results are not quite as
sharp as those of laser printers, inkjet printers provide very good quality
output at a lower cost.
Dot-matrix Printers: These use a print head to strike an inked ribbon against paper, like
a typewriter, creating characters out of a series of dots. Dot-matrix printers are the cheapest
printers available. They create text and images on the page by hammering several small
pins against an inked ribbon. The more pins used, the better the image. The 9-pin and 24-
pin are common options. The 24-pin printers produce a better quality output, but are
somewhat slower than the 9-pin printers.
Print quality for dot-matrix printers is often described in terms of mode: draft mode (low
resolution), near-letter-quality mode (medium resolution), or letter-quality mode (high
resolution). The speed depends on the mode, with the draft mode being the fastest.
The type of printer you choose depends on your budget and the type of output you need.
For example, if all you need to print are grocery lists, you may be happy with a dot-matrix
printer. In general, dot-matrix printers are noisier, slower, and produce a poorer-quality
image than do laser or inkjet printers, but they are also less expensive. If you need to print
newsletters, brochures, or illustrated reports, you will probably want a high-quality laser
printer. Laser printers cost more than other printers, but they may be worth the price
because they are fast, quiet, and produce high-quality text and graphics.
2 Monitors
The monitor does not do any processing itself. It only displays the information that the
video card tells it to display.
Monitor Sizes
The two most common monitor sizes are 15-inch and 17-inch. If you have an older, hand-
me-down PC or a very inexpensive starter PC, you may have a smaller 14-inch monitor.
21-inch monitors are also available but mostly used by graphics professionals.
3 Scanners
Scanners are peripheral devices used to digitise (convert to electronic format) artwork,
photographs, text, or other items from hard copy. In a sense, a scanner works as a pair of
eyes for your PC. Your eyes see an image and translate the image into electrical impulses
that travel to and are interpreted by your brain. Similarly, a scanner captures images and
converts them to digital data that travel to and are interpreted by the computer. A scanner
works by dividing an image into microscopic rows and columns and measuring, like the
film in a camera, how much light (or lack of it) reflects from each individual intersection
of the rows and columns. Each reflection is recorded as a dot, or picture element (pixel).
After the scanner collects information from each dot, it compiles the result into a digital
file on the computer.
There are a wide variety of scanners that work in a number of different ways, but the
technology behind them is essentially the same. The following sections discuss the more
popular types of scanners available today.
Types of Scanners
A. Flatbed Scanners
Flatbed scanners look and behave a lot like a photocopier. You lay the item to be scanned
on a glass plate and the scanning head passes below the glass.
Flatbed scanners are very versatile: you can scan objects in a variety of sizes and shapes,
including pages from a book, without damaging the original. While flatbed scanners are
the best choice for a wide variety of uses, if you plan to do a lot of text scanning (called
OCR for Optical Character Recognition) work, keep in mind that flatbeds only
accommodate one page at a time. Scanning multi-page documents can be a slow, tedious
process, because you have to manually remove one page and insert the next.
C. Hand Scanners
Hand scanners are a low-cost alternative to their larger, more sophisticated counterparts.
As their name implies, hand scanners are manual devices you move over a flat surface, just
as you do your PC's mouse.
The hand scanner’s advantages are many, but so are its disadvantages. Generally, hand
scanners work best for small, uncomplicated images such as company logos or small black-
and-white photographs. You might want a hand scanner if you do not plan to use it on a
regular basis, because it usually does not require adding internal cards to your CPU, and
it's easily disconnected and stored away. Most hand scanners can only scan a four-inch
wide image at one time and require a steady hand.
You're usually provided with software that helps you “sew up” a series of these 4-inch,
side-by-side scans into one image, but this is obviously not as convenient as getting the full
image at once.
Sound Cards
Sound cards plug into an expansion slot in your PC. The card has a set of connectors that
are exposed on the back of the PC; you can plug a microphone and speakers into the
connectors. Some cards include an optional connector for a line input, which is used to
connect another input source such as the output from a tape player or portable CD player.
Other optional connectors can include a joystick connector and a MIDI connector (for
connecting a MIDI keyboard). The card may include a volume control, which controls the
volume of the speakers and/or headphones.
CHAPTER FIVE
AUXILIARY EQUIPMENT
1 The Air Conditioner
A computer is an electronic machine. It is, therefore, capable of generating heat. A
computer is manufactured to operate in an environment with a specific temperature range.
When the temperature of the environment in which a computer is kept falls outside the
specific range, the computer may function badly and consequently get damaged. The free
air is, basically, dust laden. Dust is metallic in nature and, as such, capable of conducting
electricity. If dust is allowed to settle on a computer, particularly the electronic circuits, the
dust can bridge two circuits. The bridging of two electronic circuits may cause a serious
damage to the computer. Thus, air conditioners are needed in a computer environment to:
• condition the temperature, and
• prevent dust.
1. The Voltage Stabiliser
A computer when switched on, takes off in a cold state, warms up and gradually gets to a
hot state. In a hot state, a computer is always roaming in an attempt to find something to
do. In a situation where the public electricity, such as that of PHCN in Nigeria, is cut
suddenly, the computer would suddenly be brought to a halt. The sudden power cut may
cause the computer to lose the memory of some basic house keeping operations when
power eventually returns and the computer is switched on. The sudden power cut may also
cause irreparable damage to the file the computer was processing at the time the power was
suddenly cut.
2 Operating Systems
An operating system is a program that acts as an interface between a user of a computer
and the computer hardware. The purpose of an operating system is to provide an
environment in which a user may execute programs.
The operating system is the first component of the systems programs that interest us here.
Systems programs are programs written for direct execution on computer hardware in order
to make the power of the computer fully and efficiently accessible to applications
programmers and other computer users. Systems programming is different from
application programming because the former requires an intimate knowledge of the
computer hardware as well as the end users’ needs. Moreover, systems programs are often
large and more complex than application programs, although that is not always the case.
Since systems programs provide the foundation upon which application programs are built,
it is most important that systems programs are reliable, efficient and correct.
In a computer system the hardware provides the basic computing resources. The
applications programs define the way in which these resources are used to solve the
computing problems of the user. The operating system controls and coordinates the use of
the hardware among the various systems programs and application programs for the
various users. The basic resources of a computer system are provided by its hardware,
software and data. The operating system provides the means for the proper use of these
resources in the operation of the computer system. It
simply provides an environment within which other programs can do useful work.
We can view an operating system as a resource allocator. A computer system has many
resources (hardware and software) that may be required to solve a problem: CPU time,
memory space, file storage space, input/output devices, etc.
The operating system acts as the manager of these resources and allocates them to specific
programs and users as necessary for their tasks. Since there may be many, possibly
conflicting, requests for resources, the operating system must decide which requests are
allocated resources to operate the computer system fairly and efficiently. An operating
system is a control program. This program controls the execution of user programs to
prevent errors and improper use of the computer.
Operating systems exist because they are a reasonable way to solve the problem of creating
a usable computing system. The fundamental goal of a computer system is to execute user
programs and solve user problems.
The primary goal of an operating system is convenience for the user. Operating systems
exist because they are supposed to make it easier to compute with an operating system than
without an operating system. This is particularly clear when you look at the operating
system for small personal computers.
A secondary goal is the efficient operation of computer system. This goal is particularly
important for large, shared multi-user systems. Operating systems can attain this goal. It is
known that sometimes these two goals, convenience and efficiency, are contradictory.
While there is no universally agreed definition of the concept of an operating system, we
offer the following as a reasonable starting point: A computer’s operating system (OS) is
a group of programs designed to serve two basic purposes:
• To control the allocation and use of the computing system’s resources among the various
users and tasks.
• To provide an interface between the computer hardware and the programmer that
simplifies and makes feasible the creation, coding, debugging, and maintenance of
application programs. Specifically, we can imagine that an effective operating system
should accomplish all of the following:
• Facilitate creation and modification of program and data files through an editor program.
• Provide access to compilers to translate programs from high-level languages to machine
language.
• Provide a loader program to move the complied program code to the computer’s memory
for execution.
• Provide routines that handle the intricate details of I/O programming.
• Assure that when there are several active processes in the computer, each will get fair
and non-interfering access to the central processing unit for execution.
• Take care of storage and device allocation.
• Provide for long term storage of user information in the form of files.
• Permit system resources to be shared among users when appropriate, and be protected
from unauthorised or mischievous intervention as necessary. Though systems programs
such as editor and translators and the various utility programs (such as sort and file transfer
program) are not usually considered part of the operating system, the operating system is
responsible for providing access to these system resources.
5 File Management
File management is one of the most visible services of an operating system. Computers can
store information in several different physical forms. The magnetic tape, disk, and drum
are the most common forms. Each of these devices has it own characteristics and physical
organisation.
For the convenient use of the computer system, the operating system provides a uniform
logical view of information storage. The operating system abstracts from the physical
properties of its storage devices to define a logical storage unit, the file. Files are mapped,
by the operating system, onto physical devices.
A file is a collection of related information defined by its creator. Commonly, files
represent programs (both source and object forms) and data. Data files may be numeric,
alphabetic or alphanumeric. Files may be free-form, such as text files, or may be rigidly
formatted. In general a file is a sequence of bits, bytes, lines or records whose meaning is
defined by its creator and user. It is a very general concept.
The operating system is responsible for the following activities in connection with file
management:
• The creation and deletion of files
• The creation and deletion of directory
• The support of primitives for manipulating files and directories
• The mapping of files onto disk storage.
• Backup of files on stable (non volatile) storage.
6 Protection System
The various processes in an operating system must be protected from each other’s
activities. For that purpose, various mechanisms are used to ensure that the files, memory
segment, CPU and other resources can be operated on only by those processes that have
gained proper authorisation from the operating system.
For example, memory addressing hardware ensures that a process can only execute within
its own address space. The timer ensures that no process can gain control of the CPU
without relinquishing it. Finally, no process is allowed to do its own I/O, to protect the
integrity of the various peripheral devices.
Protection refers to a mechanism for controlling the access of programs, processes, or users
to the resources defined by a computer controls to be imposed, together with some means
of enforcement.
Protection can improve reliability by detecting latent errors at the interfaces between
component subsystems. Early detection of interface errors can often prevent contamination
of a healthy subsystem by a subsystem that is malfunctioning. An unprotected resource
cannot defend against use (or misuse) by an unauthorised or incompetent user.
7 Networking
A distributed system is a collection of processors that do not share memory or a clock.
Instead, each processor has its own local memory, and the processors communicate with
each other through various communication lines, such as high speed buses or telephone
lines. Distributed systems vary in size and function. They may involve microprocessors,
workstations, minicomputers, and large general purpose computer systems.
The processors in the system are connected through a communication network, which can
be configured in a number of different ways. The network may be fully or partially
connected. The communication network design must consider routing and connection
strategies, and the problems of connection and security. A distributed system provides the
user with access to the various resources the system maintains. Access to a shared resource
allows computation speed-up, data availability, and reliability.
8 Command Interpreter System
One of the most important components of an operating system is its command interpreter.
The command interpreter is the primary interface between the user and the rest of the
system.
Many commands are given to the operating system by control statements. When a new job
is started in a batch system or when a user logs in to a time-shared system, a program which
reads and interprets control statements is automatically executed. This program is variously
called (1) the control card interpreter, (2) the command line interpreter, (3) the shell (in
UNIX), and so on. Its function is quite simple: get the next command statement, and
execute it.
The command statement themselves deal with process management, I/O handling,
secondary storage management, main memory management, file system access, protection,
and networking.
Fig.10: Relationship between the operating system and other components of the
computer system
Language Translators
A programming language is a set of notations in which we express our instructions to the
computer. At the initial stage of computer development, programs were written in machine
language conducting the binary system i.e. 0 and 1. Such programs were hard to write,
read, debug and maintain. In an attempt to solve these problems, other computer languages
were developed. However, computers can run programs written only in machine language.
There is therefore the need to translate programs written in these other languages to
machine language. The suites of languages that translate other languages to machine
language are called language translators. The initial program written in a language different
from machine language is called the source program and its equivalent in machine language
is called object program.
Three examples of classes of language translators are assemblers, interpreters and
compilers.
1. Assemblers: An assembler is a computer program that accepts a source program in
assembly language program and reads and translates the entire program into an equivalent
program in machine language called the object program or object code. Each machine has
its own assembly language, meaning that the assembly language of one machine cannot
run on another machine.
2. Interpreters: An interpreter is a program that accepts program from a source language,
reads, translates and executes it, line by line, into machine language.
3. Compilers: A compiler is a computer program that accepts a source program in one
high-level language, reads and translates the entire user’s program into an equivalent
program in machine language, called the object program or object code. The stages in
compilation include:
• Lexical analysis
• Syntax analysis
• Semantic analysis
• Code generation
For each high-level language, there are different compilers. We can therefore talk of
COBOL Compilers, FORTRAN Compilers, BASIC Compilers, etc. A compiler also
detects syntax errors, that is, errors that arise from the use of the language. Compilers are
portable, i.e. a COBOL Compiler on one machine can run on a different machine with
minimum changes.
Utility Software
This is a set of commonly used programs in data processing departments, also called
service or general-purpose programs. They perform the following operations.
• File Conversion: This covers data transfer from any medium to another, making an exact
copy or simultaneously editing and validating. For example, copying from a hard disk to a
diskette.
• File Copy: It makes an exact copy of a file from one medium to another or from an area
of a medium to another area of the same medium.
• Housekeeping Operations: These include programs to clear areas of storage, writing file
labels and updating common data. They are not involved in solving the problem in hand.
They are operations that must be performed before and after actual processing.
Application Software
Application software is a set of programs designed to solve problems of a specific nature.
It could either be supplied by the computer manufacturer, or in some cases, the users
produce their own application program called user programs. Hence, application software
could be subdivided into two classes, namely; generalized software and userdefined
software.
Under generalised software, we have as examples: Word Processing Programs e.g. Word
Perfect, Word Star, Microsoft Word. Also included are Desktop Publishing e.g. Ventura,
PageMaker, CorelDraw, likewise the Spreadsheet program e.g. LOTUS 1,2,3, Excel,
Super-Q. Under the user-defined, software, we could have some user-defined packages for
a particular company or organisation, for accounting, payroll or some other specialised
purposes.
• The Word Processor: A word processor is used to create, edit, save and print reports. It
affords the opportunity to make amendments before printing is done. During editing a
character, word, sentence or a number of lines can be removed or inserted as the case may
be. Another facility possible is spell checking. A document can be printed as many times
as possible. Word processors are mainly used to produce letters, mailing lists, labels,
greeting cards, business cards, reports, manuals and newsletters. Examples are:
WordPerfect, WordStar, Display Writer, Professional Writer, LOTUS Manuscript, Ms-
Word, LOCO Script and MM Advantage II etc.
• The Spreadsheet: This is an application mainly designed for numerical figures and
reports. Spreadsheets contain columns and rows, in which numbers can be entered. It is
possible to change numbers before printing is done. Other features of spreadsheets are the
ability to use formulas to calculate, use sum and average function, ability to perform
automatic recalculation, and the capacity to display reports in graphical modes. The
spreadsheet is used for budgets, tables, cost analysis, financial reports, tax and statistical
analysis. Examples are: LOTUS 123, Supercalc, MS Multiplan, MS-Excel, VP Planner etc.
• Integrated Packages: They are programs or packages that perform a variety of different
processing operations using data that is compatible with whatever operation is being
carried out. They perform a number of operations like word processing, database
management and spread sheeting. Examples are: Office Writer, Logistic Symphony,
Framework, Enable, Ability, Smart Ware II, and Microsoft Works V2.
• Graphic Packages: These are packages that enable you to bring out images, diagrams
and pictures. Examples are PM, PM Plus, Graphic Writer, Photoshop.
• Database Packages: These are software for designing, setting up and subsequently
managing a database. (A database is an organised collection of data that allows for
modification, taking care of different users view). Examples are Dbase II, III, IV,
FoxBASE, Base Data Perfect, Paradox III, Revelation Advanced and MS-Access.
• Statistical Packages: These are packages that can be used to solve statistical problems,
e.g. Stat Graphical, and SPSS (Statistical Packages for Social Scientists).
• Desktop Publishing: These are packages that can be used to produce books and
documents in standard form. Examples are PageMaker, Ventura, Publishers, Paints Brush,
Xerox Form Base, News Master II, and Dbase Publisher.
• Game Packages: These are packages that contain a lot of games for children and adults.
Examples are Chess, Scrabble, Monopoly, Tune Trivia, Star Trek 2, California Game,
Soccer Game, War Game, Spy Catcher and Dracula in London.
• Communication Packages: Examples are Carbon Plus, Data Talk V3.3, Cross Talk,
SAGE Chit Chat and Data Soft. There are so many packages around, virtually for every
field of study but these are just to mention a few of them. Advantages of these packages
include that they are quicker to and cheaper implement, time saving, minimum time for its
design, they have been tested and proven to be correct, they are usually accompanied by
full documentation, and are also very portable.
User Programs
This is a suite of programs written by programmers for computer users. They are required
for the operation of their individual business or tasks. An example is a payroll package
developed for the salary operation of a particular company.
CHAPTER SEVEN
COMPUTER LANGUAGES
Basically, human beings cannot speak or write in computer language, and since computers
cannot speak or write in human language, an intermediate language had to be devised to
allow people to communicate with the computers. These intermediate languages, known
as programming languages, allow a computer programmer to direct the activities of the
computer. These languages are structured around a unique set of rules that dictate exactly
how a programmer should direct the computer to perform a specific task. With the powers
of reasoning and logic of human beings, there is the capability to accept an instruction and
understand it in many different forms. Since a computer must be programmed to respond
to specific instructions, instructions cannot be given in just any form. Programming
languages standardize the instruction process. The rules of a particular language tell the
programmer how the individual instructions must be structured and what sequence of
words and symbols must be used to form an instruction.
• An operation code
• Some operands.
The operation code tells the computer what to do such as add, subtract, multiply and divide.
The operands tell the computer the data items involved in the operations. The operands in
an instruction may consist= of the actual data that the computer may use to perform an
operation, or the storage address of data.
Some computers use many types of operation codes in their instruction format and may
provide several methods for doing the same thing. Other computers use fewer operation
codes, but have the capacity to perform more than one operation with a single instruction.
There are four basic types of instructions, namely:
(a) input-output instructions;
(b) arithmetic instructions;
(c) branching instructions; and
(d) logic instructions.
An input instruction directs the computer to accept data from a specific input device and
store it in a specific location in the store. An output instruction tells the computer to move
a piece of data from a computer storage location and record it on the output medium. All
of the basic arithmetic operations can be performed by the computer. Since arithmetic
operations involve at least two numbers, an arithmetic operation must include at least two
operands.
Branch instructions cause the computer to alter the sequence of execution of instruction
within the program. There are two basic types of branch instructions; namely unconditional
branch instruction and conditional branch instruction. An unconditional branch instruction
or statement will cause the computer to branch to a statement regardless of the existing
conditions. A conditional branch statement will cause the computer to branch to a statement
only when certain conditions exist.
Logic instructions allow the computer to change the sequence of execution of instruction,
depending on conditions built into the program by the programmer. Typical logic
operations include: shift, compare and test.
Types of Programming Language
The effective utilisation and control of a computer system is primarily through the software
of the system. We note that there are different types of software that can be used to direct
the computer system. System software directs the internal operations of the computer, and
applications software allows the programmer to use the computer to solve user made
problems. The development of programming techniques has become as important to the
advancement of computer science as the developments in hardware technology. More
sophisticated programming techniques and a wider variety of programming languages have
enabled computers to be used in an increasing number of applications.
Programming languages, the primary means of human-computer communication, have
evolved from early stages where programmers entered instructions into the computer in a
language similar to that used in the application. Computer programming languages can be
classified into the following categories:
(a) Machine language
(b) Assembly language
(c) High level symbolic language
(d) Very high level symbolic language
1 Machine Language
The earliest forms of computer programming were carried out by using languages that were
structured according to the computer stored data, that is, in a binary number system.
Programmers had to construct programs that used instructions written in binary notation 1
and 0. Writing programs in this fashion is tedious, time-consuming and susceptible to
errors. Each instruction in a machine language program consists, as mentioned before, of
two parts namely: operation code and operands. An added difficulty in machine language
programming is that the operands of an instruction must tell the computer the storage
address of the data to be processed. The programmer must designate storage locations for
both instructions and data as part of the programming process. Furthermore, the
programmer has to know the location of every switch and register that will be used in
executing the program, and must control their functions by means of instructions in the
program.
A machine language program allows the programmer to take advantage of all the features
and capabilities of the computer system for which it was designed. It is also capable of
producing the most efficient program as far as storage requirements and operating speeds
are concerned. Few programmers today write applications programs in machine language.
A machine language is computer dependent. Thus, an IBM machine language will not run
on NCR machine, DEC machine or ICL machine. A machine language is the First
Generation (computer) Language (IGL).
2 Assembly (Low Level) Language
Since machine language programming proved to be a difficult and tedious task, a symbolic
way of expressing machine language instructions is devised. In assembly language, the
operation code is expressed as a combination of letters rather than binary numbers,
sometimes called mnemonics. This allows the programmer to remember the operations
codes easily than when expressed strictly as binary numbers. The storage address or
location of the operands is expressed as a symbol rather than the actual numeric address.
After the computer has read the program, operations software are used to establish the
actual locations for each piece of data used by the program. The most popular assembly
language is the IBM Assembly Language. Because the computer understands and executes
only machine language programs, the assembly language program must be translated into
a machine language. This is accomplished by using a system software program called an
assembler. The assembler accepts an assembly language program and produces a machine
language program that the computer can actually execute. Although, assembly language
programming offers an improvement over machine language programming, it is still an
arduous task, requiring the programmer to write programs based on particular computer
operation codes. An assembly language program developed and run on IBM computers
would fail to run on ICL computers. Consequently, the portability of computer programs
in a computer installation to another computer installation which houses different makes
or types of computers were not possible. The low level languages are, generally, described
as Second Generation (Computer) Language (2GL).
The very high level language generally described as the Fourth Generation (computer)
Language (4GL), is an ill-defined term that refers to software intended to help computer
users or computer programmers to develop their own application programs more quickly
and cheaply. A 4GL, by using a menu system for example, allows users to specify what
they require, rather than describe the procedures by which these requirements are met. The
detailed procedure by which the requirements are met is done by the 4GL software which
is transparent to the users.
A 4GL offers the user an English-like set of commands and simple control structures in
which to specify general data processing or numerical operations. A program is translated
into a conventional high level language such as COBOL, which is passed to a compiler. A
4GL is, therefore, a non-procedural language. The program flows are not designed by the
programmer but by the fourth generation software itself. Each user request is for a result
rather than a procedure to obtain the result.
CHAPTER EIGHT
BASIC PRINCIPLES OF COMPUTER PROGRAMMING
Problem Solving With the Computer
The computer is a general-purpose machine with a remarkable ability to process
information. It has many capabilities, and its specific function at any particular time is
determined by the user. This depends on the program loaded into the computer memory
being utilised by the user.
There are many types of computer programs. However, the programs designed to convert
the general-purpose computer into a tool for a specific task or applications are called
“Application programs”. These are developed by users to solve their peculiar data
processing problems.
Computer programming is the act of writing a program which a computer can execute to
produce the desired result. A program is a series of instructions assembled to enable the
computer to carry out a specified procedure. A computer program is the sequence of simple
instructions into which a given problem is reduced and which is in a form the computer
can understand, either directly or after interpretation.
Programming Methodology
Principles of Good Programming
It is generally accepted that a good computer program should have the characteristics
shown below:
• Accuracy: The program must do what it is supposed to do correctly and must meet the
criteria laid down in its specification.
• Reliability: The program must always do what it is supposed to do, and never crash.
• Efficiency: Optimal utilisation of resources is essential. The program must use the
available storage space and other resources in such as way that the system speed is not
wasted.
• Robustness: The program should cope with invalid data and not stop without an
indication of the cause of the source of error.
• Usability: The program must be easy enough to use and be well documented.
• Maintainability: The program must be easy to amend, having good structuring and
documentation.
• Readability: The code of a program must be well laid out and explained with comments.
Stages of Programming
The preparation of a computer program involves a set of procedure.
These steps can be classified into eight major stages, viz
(i) Problem definition
(ii) Devising the method of solution
(iii) Developing the method using suitable aids, e.g. pseudo code or flowchart.
(iv) Writing the instructions in a programming language
(v) Transcribing the instructions into “machine sensible” form
(vi) Debugging the program
(vii) Testing the program
(viii) Documenting all the work involved in producing the program.
(i) Problem definition
The first stage requires a good understanding of the problem. The programmer (i.e. the
person writing the program) needs to thoroughly understand what is required of a problem.
A complete and precise unambiguous statement of the problem to be solved must be stated.
This will entail the detailed specification which lays down the input, processes and output
required.
(ii) Devising the method of solution
The second stage involved is spelling out the detailed algorithm. The use of a computer to
solve problems (be it scientific or business data processing problems) requires that a
procedure or an algorithm be developed for the computer to follow in solving the problem.
(iii) Developing the method of solution
There are several methods for representing or developing methods used in solving a
problem. Examples of such methods are: algorithms, flowcharts, pseudo code, and decision
tables.
(iv) Writing the instructions in a programming language
After outlining the method of solving the problem, a proper understanding of the syntax of
the programming language to be used is necessary in order to write the series of instructions
required to get the problem solved.
(v) Transcribing the instructions into machine sensible form
After the program is coded, it is converted into machine sensible form or machine
language. There are some manufacturers written programs that translate users programs
(source programs) into machine language (object code). These are called translators and
instructions that machines can execute at a go, while interpreters accept a program and
execute it line-by-line.
During translation, the translator carries out syntax check on the source program to detect
errors that may arise from wrong use of the programming language.
(vi) Program debugging
A program seldomly executes successfully the first time. It normally contains a few errors
(bugs). Debugging is the process of locating and correcting errors. There are three classes
of errors.
• Syntax errors: Caused by mistake coding (illegal use of a feature of the programming
language).
• Logic errors: Caused by faulty logic in the design of the program. The program will
work but not as intended.
• Execution errors: The program works as intended but illegal input or other
circumstances at run-time makes the program stop.
There are two basic levels of debugging. The first level called desk checking or dry running
is performed after the program has been coded and entered or key punched. Its purpose is
to locate and remove as many logical and clerical errors as possible. The program is then
read (or loaded) into the computer and processed by a language translator. The function of
the translator is to convert the program statements into the binary code of the computer
called the object code. As part of the translation process, the program statements are
examined to verify that they have been coded correctly, if errors are detected, a series of
diagnostics referred to as an error message list is generated by the language translator. With
this list in the hand of the programmer, the second level of debugging is reached. The error
message list helps the programmer to find the cause of errors and make the necessary
corrections. At this point, the program may contain entering errors, as well as clerical errors
or logic errors. The programming language manual will be very useful at this stage of
program development.
After corrections have been made, the program is again read into the computer and again
processed by the language translator. This is repeated over and over again until the program
is error-free.
(vii) Program testing
The purpose of testing is to determine whether a program consistently produces correct or
expected results. A program is normally tested by executing it with a given set of input
data (called test data), for which correct results are known.
For effective testing of a program, the testing procedure is broken into three segments.
a. The program is tested with inputs that one would normally expect for an execution of
the program.
b. Valid but slightly abnormal data is injected (used) to determine the capabilities of the
program to cope with exceptions. For example, minimum and maximum values allowable
for a sales amount field may be provided as input to verify that the program
processed them correctly.
c. Invalid data is inserted to test the program’s error-handling routines. If the result of the
testing is not adequate, then minor logic errors still abound in the program. The
programmer can use any of these three alternatives to locate the bugs.
Other methods of testing a program for correctness include:
• Manual walk-through: The programmer traces the processing steps manually to find
the errors, pretending to be the computer, following the execution of each statement in the
program, noting whether or not the expected results are produced.
• Use of tracing routines: If this is available for the language, this is similar to (1) above
but is carried out by the computer; hence it takes less time and is not susceptible to human
error.
• Storage dump: This is the printout of the contents of the computer’s storage locations.
By examining the contents of the various locations, when the program is halted, the
instruction at which the program is halted can be determined. This is an important clue to
finding the error that caused the halt.
• Program documentation: Documentation of the program should be developed at every
stage of the programming cycle.
The following are documentations that should be done for each program.
(a) Problem Definition Step
• A clear statement of the problem
• The objectives of the program (what the program is to accomplish)
• Source of request for the program.
• Person/official authorising the request
(b) Planning the Solution Step
• Flowchart, pseudo code or decision tables
• Program narrative
• Descriptive of input, and file formats
(c) Program source coding sheet
(d) User’s manual to aid persons who are not familiar with the program to apply it correctly.
The manual it contains a description of the program and what it is designed to achieve.
(e) Operator’s manual to assist the computer operator to successfully run the program. This
manual contains:
(i) Instructions about starting, running and terminating the program.
(ii) Message that may be printed on the console or VDU (terminal) and their meanings.
(iii) Setup and take down instruction for files.
Advantages of Program Documentation
a. It provides all necessary information for anyone who comes in contact with the program.
b. It helps the supervisor in determining the program’s purpose, how long the program will
be useful and future revision that may be necessary.
c. It simplifies program maintenance (revision or updating).
d. It provides information as to the use of the program to those unfamiliar with it.
e. It provides operating instructions to the computer operator.
CHAPTER NINE
FLOWCHARTS AND ALGORITHMS
A flowchart is a graphical representation of the major steps of work in process. It displays
in separate boxes the essential steps of the program and shows by means of arrows the
directions of information flow. The boxes, most often referred to as illustrative symbols,
may represent documents, machines or actions taken during the process. The area of
concentration is on where or who does what, rather than on how it is done. A flowchart can
also be said to be a graphical representation of an algorithm, that is, it is a visual picture
which gives the steps of an algorithm and also the flow of control between the various
steps.
3.6 Pseudocodes
A pseudocode is a program design aid that serves the function of a flowchart in expressing
the detailed logic of a program. Sometimes a program flowchart might be inadequate for
expressing the control flow and logic of a program. By using Pseudocodes, program
algorithms can be expressed as English-language statements. These statements can be used
both as a guide when coding the program in a specific language and as documentation for
review by others. Because there is no rigid rule for constructing pseudocodes, the logic of
the program can be expressed in a manner that does not conform to any particular
programming language. A series of structured words is used to express the major program
functions. These structured words are the basis for writing programs using a technical term
called “structure programming”.
In addition to payroll preparation, the computer is also used for other routine and repetitive
book keeping and accounting operations involving recording, classifying and summarising
accounting data. This may involve preparing and updating ledger and journal accounts,
invoicing, accounts receivable and payable. Other operations may also include
updating and preparing accounts on sales, purchases and inventory. The computer is also
used for the preparation and evaluation of the balance sheet and statements of accounts
and, preparation of dividends and summary accounts for shareholders and management.
(ii) Inventory Control
An equally important business application of the computer is seen in the execution of the
important business function involved in maintaining a desirable level of inventory in a
business organisation. This is to ensure that working capital is not unduly tied in stocks
while at the same time available stocks can meet the demands of continued production
processes. In this direction, the computer is used as a tool in updating records of inventory
and also in the preparation of forecasts and demand predictions based on economic order
quantity analysis and other forecasting techniques.
(iii) Auditing Operations
The computer is used as a tool by auditors to report accurately on the transaction register
which constitutes the most crucial aspect in the audit trail. With the aid of the computer, it
is easier for auditors, in their examination of the accounting records of a business, to trace
routine business operations so that variances can be detected and verified accurately using
various computer audit packages.
(iv) Management Information System
An equally challenging and revolutionary application of the computer in business is the
important role the computer-based Management Information System (MIS) is playing in
management decision making. The computer is used as a tool for the online storage,
retrieval, processing and maintenance of corporate data meant to be shared by all the users’
departments.
A Management Information System involves a computerised system of data processing
procedures which are integrated in an organisation to provide accurate, complete, concise,
timely and effective data which management can use at various levels of decision making
for planning, organising, directing, controlling and monitoring procedures. Included in
Management Information System to be used for the various decision making procedures
are a number of systems comprising:
• Controlling and operational planning support systems to deal with day-to-day decisions
involving routine processing and transaction procedures.
• Tactical support systems to deal with short-run and middle level management decisions.
• Strategic support systems to deal with corporate strategic and top level management
decisions.
With the aid of these support systems, data can be retrieved and analysed on a continuous
and timely basis to aid management decision making and other management functions
about sales, finances, purchases, acquisition of plant and equipment, research, market
analysis and so on.
CHAPTER TWELVE
COMPUTER APPLICATIONS IN GOVERNMENT, SCIENCE,
ENGINEERING, TRANSPORT, COMMUNICATIONS, RECREATION
AND THE MILITARY
Computers are commonly used to find accurate solutions to both scientific and engineering
problems. Weather forecasting has now become a daily activity to which the computer has
proved very useful in providing information on the kind of weather we are likely to expect
over a period of time. Such accurate predictions help the farmers, airline operators,
navigators and other activities which depend on the weather for their operations. Computer
aided critical path study is used to monitor the optimum and efficient use of time, money,
material and human resources in the execution and implementation of projects. Such
critical path study is used successfully in various projects, for example, the construction of
roads, bridges, buildings, manufacturing, the conduct of elections and sales campaigns.
Another scientific application of in computer is the monitoring and simulation modelling
techniques, to provide indicators as to how systems such as the human body, economy,
weather, demographic variables and so on react to changes in situations. The application
of simulation techniques helps in taking decisions and precautions in advance, in case there
are repercussions help when the desired changes are introduced in practical situations.
Computers also help to design buildings, roads, bridges, vehicles, aeroplanes, ships and
complex architectural, works computer. Prototyping is increasingly being used in the
construction of systems to minimise the financial losses in real life situations.
The computer is also used to find solutions to very complex mathematical and statistical
computations at incredible speeds and accuracy. Furthermore, various software packages
are now increasingly being developed to analyse surveyed data, construct live tables,
perform mortality demographic and other multivariate data analysis designed to
revolutionise scientific research and to find practical solutions to complex, challenging and
everyday life situations. We now outline the use of the computer in the following specific
areas, among others.
1 Marketing Departments
(a) Comparative analysis of products of two or more companies with a view to predicting
some areas of improvement.
(b) Market survey, statistical analysis of proportional market gains and prediction of new
market areas.
(c) Creation of consumer awareness and appreciation of products.
3.3 Agriculture
(a) Keeping records of soil, rainfall, weather conditions, land size, crops, and chemicals
and ultimately processing the records to estimate soil fertility and yield per hectare over a
number of years.
(b) Keeping records, of poultry and animal husbandry farm with a view to estimating the
feed mix and environmental conditions desirable for optimal yield.
(c) Assessing the behaviour patterns of farmers in a cooperative venture, and assisting in
matching the farmers that have identical behaviour with a view to optimizing their
productivity.
Government
The business of governance is serious business. In a multi-cultural, multilingual, multi-
ethnic, setting such as Nigeria, a lot of complex and often conflicting variables interplay or
are taken into consideration before a broad-based decision can be taken. Computers can
assist government business in the following ways:
(a) Planning
(b) Decision marking
(c) Policy formulation
(d) Monitoring and control of operations
The availability of data, timely access to the data and timely reporting on the data are very
crucial to the above listed business of government.
Computers can be used to:
(a) Keep accurate records of government assets and periodically estimate the market value
and insurance value.
(b) Keep accurate records of the population, behaviour patterns, and consumption patterns
of utilities, and estimate the distribution of basic needs such as electricity, water, telephone
and postal services.
(c) Keep records of government revenue and expenditure and assist government in
monitoring, controlling and evaluating the revenue and expenditure.
(d) Keep records of government employees with a view to:
(i) Preventing ghost workers
(ii) Estimating the strength of the human resources of government
(iii) Producing statistical data on employees
(e) Issue identity cards to the citizens.
(f) Compile a broad-based and accurate voters register. This will check the incidence of
ghost voting, multiple voting and other electoral malpractices, which have be devilled the
electoral processes and stable polity in third world countries.
(g) Keep track of crime in society, thereby helping government security agencies to check
crime.
(h) Maintain the database of the mineral resources and other resources of the nation.
The Military
One of the areas in which the computer has been applied intensively and extensively is the
military. The first generation of the modern computers were designed and used during the
First and Second World Wars. The use of computers for processing data became more
popular during these periods due to the need to procure, store and process large volumes
of data. Over the years, the use of computers has transcended the traditional role of
“crunching numbers” to sophisticated applications.
Specifically, computers are being used in the following ways, in military operations:
• Training the personnel through the use of simulated war situations.
• Reconnaissance surveys.
• Automatic detection of mines.
• Monitoring and tracking of planes with a view to bringing down any unauthorised plane
flying in the nation’s airspace.
• Monitoring operations in the military base.
• Launching of missiles from distant military bases to the enemy
territory. Such missiles are programmed to ensure that only the desired targets are hit.
• Manufacture of state-of-the-art military hardware and consumables.
• Communication and transmission of highly coded classified military information.
• Military games, adventures and expeditions.
• Keeping records of military personnel and logistics.
• Keeping records of military assets – hardware
• Management of military stock with a view to maintaining warready stock of materials,
ammunition and assets at any point in time.
• Monitoring the environmental and storage conditions of lethar weapons in order to
prevent accidents, like sudden explosions caused by improper storage.
• Generation and maintenance of necessary data that would enhance planning, policy
formulation, decision making and forecast.
CHAPTER THIRTEEN
COMPUTER VIRUS
One of the biggest fears of having computers is viruses. Viruses are malicious programs
designed entirely for destruction and havoc. Viruses are created by people who either know
a lot about programming or know a lot about computers.
Computer virus is one of the greatest threats to computers and computer applications.
Once the virus is made, it is generally distributed through shareware, pirated software, e-
mail or other various ways of transporting data. Once the virus infects someone's computer
it will either start infecting other data, destroying data, overwriting data, or corrupting
software. The reason these programs are called viruses is that they spread like human
viruses. Once your PC has become infected, either by downloading something from the
Internet or sharing software, any disks or writeable media that you place into the computer
will then be infected. When that disk is put into another computer, the computer is also
infected. And if the user puts files on the Internet, and hundreds of people download those
files, they will all be infected, and the process will continue infecting thousands if not
millions of computers.
Virus Properties
Your computer can be infected even if files are just copied: Because some viruses are
memory resident, as soon as a diskette or program is loaded into memory, the virus attaches
itself into memory.
Viruses can be polymorphic: Some viruses have the capability of modifying their code,
which means one virus could have various amounts of similar variants.
Viruses can be memory/Non memory resident: Depending on the type, a virus can be a
memory resident virus type, which first attaches itself into memory and then infects the
computer. The virus can also be Non memory resident, which means a program must be
run in order to infect the computer.
A virus can be a stealth virus: Stealth viruses first attach themselves to files on the
computer, and then attack the computer. This causes the virus to spread more rapidly.
Viruses can carry other viruses and infect a system, and infect with the other viruses
as well: Because viruses are generally written by different individuals and do not infect the
same locations of memory and or files, this could mean that multiple viruses can be stored
in one file, diskette or computer.
Viruses can make the system never show outward signs: Some viruses will hide changes
made, such as when infecting a file, the file will stay the same size.
Viruses can stay on the computer even if the computer is formatted:
Viruses have the capability of infecting different portions of the computer such as the
CMOS battery or master.
How Viruses May Infect Files
Viruses can infect any files, however they usually attack .com, .exe, .sys, .bin, .pif or any
data files. Viruses have the capability of infecting any file. However they will generally
infect executable files or data files such as Word or Excel documents which are opened
frequently.
Viruses can increase the file’s size; however this can be hidden:
When infecting files, viruses will generally increase the size of the file. However with more
sophisticated viruses, these changes can be hidden.
Viruses can delete files as the files are run: Because most files are loaded into memory
and then run once the program is in memory, the virus can delete the file.
Viruses can corrupt files randomly: Some destructive viruses are not designed to destroy
random data but instead randomly delete or corrupt files.
Viruses can cause write protect errors when executing .exe files from a write
protected disk: Viruses may need to write themselves to files which are executed. Because
of this, if a diskette is write protected, you may receive a write protection error.
Viruses can convert .exe files to .com files: Viruses may use a separate file to run the
program and rename the original file to another extension, so the .exe is run before the
.com.
Viruses can reboot the computer when a file is run: Various computers may be designed
to reboot the computer when run.
Detecting Viruses
The most commonly used method of protecting against and detecting viruses is to purchase
a third party application designed to scan for all types of viruses. Alternatively, a user can
look at various aspects of the computer and detect possible signs indicating a virus is on
the computer. While this method can be used to determine some viruses, it cannot clean or
determine the exact virus you may or may not have.
REFERENCES
Akinyokun, O.C. (1999). Principles and Practice of Computing Technology. Ibadan:
International Publishers Limited.
Balogun, V.F., Daramola, O.A. Obe, O.O. Ojokoh, B.A., and Oluwadare S.A. (2006).
Introduction to Computing: A Practical Approach. Akure: Tom- Ray Publications.
SPRING-UP COLLEGE OF HEALTH AND
TECHNOLOGY, ONDO CITY, ONDO
STATE.
GENERAL STUDIES
LECTURER IN CHARGE:
PRINCE SAMUEL A GBADEHAN
INTRODUCTION TO COMPUTER
Course Writer: Mr. Oluwatosin A. Godwin CPhT, RDN.
(Deputy Provost Academic)
Spring-Up College of Health Science and Technology,
Ondo City, Ondo State.
URL: [Link]
Printed: 2023
INTRODUCTION
The computer is fast becoming the universal machine of the twenty-first century. Early
computers were large in size and too expensive to be owned by individuals. Thus they were
confined to the laboratories and few research institutes. They could only be programmed
by computer engineers. The basic applications were confined to undertaking complex
calculations in science and engineering. Today, the computer is no longer confined to the
laboratory. Computers, and indeed, computing have become embedded in almost every
item we use. Computing is fast becoming ubiquitous. Its application transcends science,
engineering, communication, space science, aviation, financial institutions, social sciences,
humanities, the military, transportation, manufacturing, the extractive industries to mention
but a few.
Also, early computers were designed to accept numeric data, but over the years computers
have been developed to accept not only numeric data, but we also able to process
multimedia data – text, audio and video. The combination of computer technology and
communications technology gave birth to what is now widely known as Information and
Communication Technologies (ICT). ICT has changed the face of virtually all fields of
human endeavour, ranging from science to engineering, commerce and industry,
international trade, transportation, culture and tourism, education and research, among
others. Nowadays, literacy is not only measured by the ability to read and write, but also
includes computer literacy. The wave of globlisation which has been largely propelled by
the collapse of barriers of distance between nations and peoples in the world as a result of
ICT, makes it imperative for the modern man to have at least the basic knowledge of
computers. This course is meant to introduce students to the historical evolution of
computers, the basic components of computers, and some of its applications in society.
COURSE AIMS
The aim of this course is to provide students with the basic understanding of the computer
and its applications in everyday life.
COURSE OBJECTIVES
The specific objectives of this course are to:
• Provide basic understanding of the historical evolution of the computer, types of
computers and the classification of computers.
• Enable the students to understand the components of the computer – the hardware and
software.
• Help students to identify the different categories of computer software and their uses.
• Introduce students to computer programming with emphasis on the building blocks and
stages of programming and writing of computer programs using visual basic.
• Enable students to identify and appreciate the areas of application of computers in
society, thereby stimulating their thought to regard the computer as a tool for human use
rather than a master.
• Create awareness at the early stage of the study of computers about the potential threats
that computer viruses pose to the smooth operations of computers.
COURSE CONTENTS
Chapter 1 Basic Concepts
Chapter 2 Historical Overview of the Computer
Chapter 3 Classification of Computers
Chapter 4 Hardware Components (1)
Chapter 5 Auxiliary Equipment
Chapter 6 Computer Software
Chapter 7 Application of Computers in Education
Chapter 8 Application of Computers in Business and Industry
Chapter 9 Application of Computers in Government, Military, etc
Chapter 10 Computer Virus
CHAPTER ONE
BASIC CONCEPTS
The computer is fast becoming the universal machine of the 21st century. Early computers
were large in size and too expensive to be owned by individuals. Thus they were confined
to the laboratories and few research institutes. They could only be programmed by
computer engineers. The basic applications were confined to undertaking complex
calculations in science and engineering. Today, the computer is no longer confined to the
laboratory. Computers and, indeed, computing have become embedded in almost every
item we use. Computing is fast becoming ubiquitous. Its application transcends science,
engineering, communication, space science, aviation, financial institutions, social sciences,
humanities, the military, transportation, manufacturing, and extractive industries to
mention but a few. This unit presents the background information about computers.
Definitions
Computer: A computer is basically defined as a tool or machine used for processing data
to give required information. It is capable of:
• taking input data through the keyboard (input unit),
• storing the input data in a diskette, hard disk or other medium,
• processing it in the central processing unit (CPU) and
• giving out the result (output) on the screen or the Visual Display Unit (VDU).
Data: The term data refers to facts about a person, object or place, e.g. name, age,
complexion, school, class, height etc.
Information: This is referred to as processed data or a meaningful statement, e.g. net pay
of workers, examination results of students, list of successful candidates in an examination
or interview etc.
Characteristics of a Computer
• Speed: The computer can manipulate large data at incredible speed and response time
can be very fast.
• Accuracy: Its accuracy is very high and its consistency can be relied upon. Errors
committed in computing are mostly due to human rather than technological weakness.
There are in-built error detecting schemes in the computer.
• Storage: It has both internal and external storage facilities for holding data and
instructions. This capacity varies from one machine to the other. Memories are built up in
K (Kilo) modules where K=1024 memory locations.
• Automatic: Once a program is in the computer’s memory, it can run automatically each
time it is opened. The individual has little or no instruction to give again.
• Reliability: Being a machine, a computer does not suffer human traits of tiredness and
lack of concentration. It will perform the last job with the same speed and accuracy as the
first job every time even if ten million jobs are involved.
• Flexibility: It can perform any type of task once it can be reduced to logical steps.
Modern computers can be used to perform a variety of functions like on-line processing,
multiprogramming, real time processing etc.
Software
Computer software is the series of instructions that enable the computer to perform a task
or group of tasks. A program is made up of a group of instructions to perform a task. Series
of programs linked together make up software. Computer programs could be categorised
into system software, utility software, and application programs.
Computer Users
Computer users are the different categories of personnel that operate the computer. We
have expert users and casual users. The expert users could be further categorised into
computer engineers, computer programmers and computer operators.
INTRODUCTION
The computer as we know it today has evolved over the ages. An attempt is made in this
unit to present in chronological order the various landmarks and milestones in the
development of the computer. Based on the milestone achievement of each era, the
computer evolution is categorised into generations. The generational classification,
however, is not rigid as we may find one generation eating into the next.
Classification by Purpose
Depending on their flexibility in operation, computers are classified as either special
purpose or general purpose.
b. Special-Purpose Computers
A special purpose computer is one that is designed to solve a restricted class of problems.
Such computers may even be designed and built to handle only one job. In such machines,
the steps or operations that the computer follows may be built into the hardware. Most of
the computers used for military purposes fall into this class. Other examples of special
purpose computers include:
• Computers designed specifically to solve navigational problems.
• Computers designed for tracking airplanes or missiles
• Computers used for process control applications in industries such as oil refinery,
chemical manufacture, steel processing and power generation
• Computers used as robots in factories like vehicle assembly plants and glass industries.
General Attributes of Special-Purpose Computers
Special-purpose computers are usually very efficient for the tasks for which they are
specially designed.
4. They are very much less complex than the general-purpose computers.
5. The simplicity of the circuiting stems from the fact that provision is made only for
limited facilities.
6. They are very much cheaper than the general-purpose type since they involve fewer
components and are less complex.
General-Purpose Computers
General-purpose computers are computers designed to handle a wide range of problems.
Theoretically, a general-purpose computer can be adequate by means of some easily
alterable instructions to handle any problems that can be solved by computation. In
practice, however, there are limitations imposed by memory size, speed and the type of
input/output devices. Examples of areas where general purpose computers are employed
include the following:
• Payroll
• Banking
• Billing
• Sales analysis
• Cost accounting
• Manufacturing scheduling
• Inventory control
Microcomputers
Microcomputers, also known as single board computers, are the cheapest class of
computers. In the microcomputer, we do not have a Central Processing Unit (CPU) as we
have in the larger computers. Rather we have a microprocessor chip as the main data
processing unit. They are the cheapest and smallest, and can operate under normal office
conditions. Examples are IBM, APPLE, COMPAQ, Hewlett Packard (HP), Dell and
Toshiba, etc.
Mini Computers
Mini computers have memory capacity in the range ‘128- 256 Kbytes’ and are also not
expensive but reliable and smaller in size compare to mainframe. They were first
introduced in 1965; when DEC (Digital Equipment Corporation) built the PDP – [Link]
mini computers are WANG VS.
Mainframe Computers
The mainframe computers, often called number crunchers have memory capacity of the
order of ‘4 Kbytes’, and are very expensive. They can execute up to 100 MIPS (Meanwhile
Instructions per Second). They have large systems and are used by many people for a
variety of purposes.
CHAPTER FOUR
HARDWARE COMPONENTS
Your personal computer (PC) is really a collection of separate items working together as a
team, with you as the captain. Some of these components are essential; others simply make
working more pleasant or efficient. Adding extra items expands the variety of tasks you
can accomplish with your machine.
Key Lock
You can stop intruders from tampering with your PC by using the lock on the front panel.
Turning the key prevents the keyboard from working.
Turbo Button
Some PCs offer a choice of speeds at which they can run. A turbo switch is usually left so
the computer runs at its fastest speed.
Reset Button
If your PC “freezes” and won’t respond to any command, try starting it up again using the
reset button. Pressing the reset button loses all the work you have not saved in that session,
so use it only as a last resort.
Power On/Off
All PCs have main power switch on the system unit. Sometimes this control is placed on
the outside back panel.
Serial Ports
Serial ports often connect the PC to the modem or mouse. Most PCs are fitted with two
serial ports that may be labeled “S101” and “S102”, “Serial 1” and “Serial 2”, or “COM
1” and “COM 2”.
Sound Jacks
If you have a sound fitted inside your system unit, you will see a jack or jacks at the back.
These can be used to connect your PC to speakers, a microphone, or an external sound
source.
The Keyboard Port
The cable from your keyboard ends with a round connector, which plugs into the keyboard
port.
The Network Adapter
If an expansion card is fitted to link your PC with other PCs in your office you will see a
network connector at the back of the system unit.
The Monitor Port
A cable from your monitor plugs into this port and carries display information to the
monitor.
Bays for Expansion Cards
PCs are easily expanded, perhaps to provide modem, sound or faster graphics. You can
plug cards into expansion slots inside the PC. The end of an expansion card shows at the
back of your machine, allowing you to connect items.
The Battery
A small battery powers a clock to keep track of the time when the PC is turned off. It also
maintains low electricity to certain RAM chips that record which components are installed.
The Disk Drive Controller Card
This card controls the PC’s disk drive motors and transfers data. The serial and parallel
ports at the back of the card link internal PC components with external devices such as
mouse and printer.
The Display Adapter Card (Video Card)
All the information your computer will display is stored in its memory. To be useful, you
need to see the information. The display adapter card is the link between the PC’s memory
and the monitor.
Expansion Slots
These long narrow connectors allow you to plug in expansion cards (also known as adapter
cards), which offer extra options not available on a basic PC.
ROM Chips
Read-only memory (ROM) chips have data written on them during manufacturing that tells
the CPU what to do when the PC is switched on. The data is always there, even when you
switch the PC off.
RAM Chips
When a computer is switched on and is running a program, RAM (Random Access
Memory) is used for purposes such as holding the program and its data. But when the PC
is switched off, anything held in RAM is lost.
Empty RAM Chip Slots
These slots let you expand your computer’s memory by adding extra RAM chips or
modules. Some PCs work even faster because they come equipped with Cache Memory.
Cache memory consists of expensive and very fast memory chips that store the data or
instructions that the CPU will look at next. Cache memory can speed up work on your
computer enormously.
Intel CPUs
The earliest PCs were equipped with a CPU from Intel Corporation called the 8088. The
next generation of PCs used CPU known by the number “80286” and were called “PC/AT”
computers. Subsequently, PCs have been supplied with more and more powerful CPUs –
the 80386, the 80486, and the more recent and impressive of all, the Intel Pentium (I, II,
III, IV& M).
All these PC processors belong to a family called 80 x 86. In general, you can run the same
software on PCs containing different CPUs within this family. From the outside, the chips
look different only in sizes and number of pin-put inside. An 80486 has over one million
components to the 3,500 that were in the first 8088. Because of these differences, the
Blatest Pentiums runs over ten times faster.
CPU Speed
The speed of a CPU is measured in megahertz (MHz). A computer has a central clock that
keeps all the components in time with each other; one hertz is similar to a clock tick and
megahertz is equal to one million ticks per second. If your PC runs at 333 or 400MHz, the
central clock ticks 333 or 400 million times every second. As you might imagine, the faster
the clock ticks, the faster the computer runs.
Without the CPU, there would be no PC. Like all other hardware components, CPUs are
continually undergoing further development. You can see the explosive technological
development in data processing most clearly in the development of newer and faster CPUs.
The CPUs have for years doubled their performance about every 18 months and there are
no indications that this trend will stop.
When we now look at all the CPUs from a broader perspective, we can see that:
• The CPU history is closely tied to the companies IBM and, especially, Intel.
• The CPUs have their roots back to Intel's chip 4004 from 1971.
• The compatibility concept has been important throughout the
development.
Generations of CPUs
There are CPUs of many brand names (IBM, Texas, Cyrix, AMD), and often they make
models which overlap two generations. This can make it difficult to keep track of CPUs.
Here is an attempt to identify the various CPUs according to generations:
DISKS
Floppy Disks
Computers use disks to store information. Although there is a permanent hard disk that
lives inside the system unit, you can use floppy disks to store and move data easily from
one PC to another. Floppy disks come in two sizes, either 5¼ or 3½ inches in diameter.
The smaller disks are able to store more data and are also less easily damaged, because of
their thicker plastic cases. As both sizes can be either “high” or “low” capacity (or density),
there are four main varieties of disks available. High-capacity disks are more expensive,
but they can store much more information. Low-capacity disks are generally labeled
DS/DD, which stands for “double sided/double density”, while the highcapacity floppy
disks are labelled DS/HD (double sided/high-density).
Input Devices
1 The Computer Keyboard
A computer keyboard is identical to the conventional typewriter keyboard. However, it has
more keys than the typewriter keyboard. A computer keyboard can be a dummy type or
intelligent type. A computer keyboard is considered to be intelligent if, in addition to
performing the routine functions characteristic of a typewriter keyboard, it can initiate a
series of actions for a computer to carry out by mere pressing a key or combination of two
or more keys. Thus, an intelligent computer keyboard has a set of keys which, when one
of them is pressed, the computer can be made to carry out a specific function. For example,
the pressing of a key may cause the computer to display a menu list from which the user
may be prompted to select one.
The intelligent computer keyboard has four major divisions, namely: Function keys,
Alphanumeric keys, Numeric keys and Control keys. In addition to the four types of keys,
there are some special or important keys such as the following:
(a) Return or Enter key
(b) Escape key denoted by ESC
(c) Control key denoted by CTRL
(d) Alternate key denoted by ALT
(e) Delete key denoted by DEL
(f) Insert key denoted by INS
(g) Backspace key
(h) Shift key.
Function Keys
The effects of the functions keys are software package dependent. That is, they mean
different translations depending on which software package one is running on the
computer. The function keys are traditionally labeled F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11 and F12. The function keys are often arranged to the left of the main keyboard in
two columns or they are arranged in a row above the main keyboard. In most software
packages, the function key F1 is used to run the HELP program. Word perfect, for example,
uses F3 for HELP program and F1 to cancel the last command issued on the computer. The
function keys F7 and F12 are used to save a text and block a section of a text respectively
in word perfect. Function keys can be programmed to carry out the functions desired by a
programmer. For example the function key F10 may be programmed to display menus.
Thus, the operations of the function keys can be determined by the user or programmed by
the software package being used at any point in time.
Alphanumeric Keys
The Alphanumeric keys can be likened with the conventional typewriter keys. They contain
alphabetic characters, numeric characters and special characters such as comma, full stop,
open bracket, close bracket, asterisk, semicolon, colon, question mark, and so on. Usually,
each key carries a character at the lower part and another character at the upper part. The
SHIFT key is used to switch on or off the lower and upper characters by the programmer.
Other cursor control keys are Home, Page Up, Page Down, and End. These keys may be
part of the numeric keypad or separated from the numeric keypad. Moving the cursor
around on the screen is one of the most common tasks in an application program. In fact,
cursor movement is so important in an application such as word processing that it can
usually be accomplished by additional key-driven commands.
The Spacebar
The spacebar is the longest key found on most keyboards. It erases characters at the cursor
position or gives a blank space when pressed.
The Tab Key
The tab key moves the cursor by five spaces to the right when pressed. The number of
positions moved depends on the software or the Tab Set by the operator. The Tab is
normally pressed to insert paragraphs during typing. In some programs, when this key is
pressed in combination with shift the key, the same number of positions is moved
backwards.
The Print Screen Key (Prtsc)
When the print screen key is pressed in combination with the shift key, whatever in is on
the screen will be printed on a printer. The same effect can be achieved by pressing the key
alone on some keyboards.
Keeping Your Keyboard Clean and Working
Never spill liquids on your keyboard. Coffee, soda, and other beverage spills can ruin your
keyboard. Liquid spills on the keyboard have even been known to cause electrical damage
to the PC itself. With that in mind, though you may not stop drinking coffee around your
computer, you should at least get a spill-proof mug or keep the coffee on the other
side of the desk.
Another enemy of the keyboard is static electricity. Static electricity can have the same
damaging effect on your keyboard as does liquid. If your keyboard doesn't respond
properly after a strong static charge, you may just need to turn off the PC and turn it back
on to reset the keyboard. In some cases, however, the static discharge can zap the keyboard
and even parts of the PC. If you shuffle your feet across the carpet or your PC is in a room
with dry air, avoid touching the PC or the keyboard until you have touched something
metal to discharge any static electricity. If you don't have a metal desk or bookcase in your
work area, consider buying an anti-static mat and keeping it where you can touch it before
touching the PC.
Dust, dirt, food crumbs, and hair are other enemies of the keyboard. Try to avoid eating
over the keyboard and if your computer is in a dirty, dusty area, keep the keyboard covered
when not in use. Some dirt and dust is unavoidable. To keep the keyboard working well,
you should occasionally clean it.
2 The Mouse and Joystick
A mouse looks like the electrical clipper in a barber’s shop. It consists of a pointing device
very sensitive to movements. It has a roller ball and two or more buttons which can be
pressed to make a selection. By moving the mouse on a flat smooth surface and clicking
one or a combination of two buttons on its upper surface, a computer to which it is
connected can be sensitised and commanded to carry out some specific tasks.
A mouse can be used to draw diagrams on the computer screen more effectively and
efficiently than the computer keyboard. Generally, the keyboard and the mouse do
complement each other. For example, the mouse can be used to highlight an item in a menu
list while the keyboard Enter Key can be pressed to activate or evoke the command
associated with the highlighted item.
A mouse is the primary input device for modern computers that feature operating systems
with a graphical user interface, such as Windows 98 or Windows XP. While keyboards
obviously excel at entering text, numbers, and symbols, your mouse is the tool you'll use
to tell your computer what to do with all the data you've entered.
Joysticks are almost exclusively used with game software and help the user more
effectively control the actions of computer-simulated airplanes or arcade-style games.
All modern PC operating systems (Windows 98, Windows XP, and the Macintosh) rely on
an on-screen pointer to select and execute commands. A mouse is simply an input device
built to help the user control this on-screen pointer in as natural and efficient a manner as
possible.
The pointer on the screen mimics the movements of your mouse. As you move your mouse,
a ball encased in the bottom of your mouse rolls on the desk and in turn sends signals to
the computer as to which direction to move the pointer on the screen. Move the mouse side
to side, or up and down, and the on-screen pointer moves in a similar manner.
Once you have the mouse positioned to select the command or data you want to act on, you
use the mouse buttons to execute the command. The mouse controls the on-screen pointer
and lets you select program icons, manipulate property sheets, and access data.
Output Devices
1 Printers
A printer is the computer component that lets you create copies of the information stored
in your computer on paper. The printed material is often called the hard copy, to
differentiate it from the data stored on a disk, or held in the computer's memory.
There are three basic types of printers available for use with personal computers:
Laser Printers: These combine a magnetic roller with powdered ink called toner to
transfer high-quality characters or images onto a page.
Inkjet Printers: These have small nozzles that actually spray fast drying ink onto the page
to form characters or images. Inkjet printers spray a fine, quick-drying ink through small
nozzles to produce characters and images on paper. Although the results are not quite as
sharp as those of laser printers, inkjet printers provide very good quality
output at a lower cost.
Dot-matrix Printers: These use a print head to strike an inked ribbon against paper, like
a typewriter, creating characters out of a series of dots. Dot-matrix printers are the cheapest
printers available. They create text and images on the page by hammering several small
pins against an inked ribbon. The more pins used, the better the image. The 9-pin and 24-
pin are common options. The 24-pin printers produce a better quality output, but are
somewhat slower than the 9-pin printers.
Print quality for dot-matrix printers is often described in terms of mode: draft mode (low
resolution), near-letter-quality mode (medium resolution), or letter-quality mode (high
resolution). The speed depends on the mode, with the draft mode being the fastest.
The type of printer you choose depends on your budget and the type of output you need.
For example, if all you need to print are grocery lists, you may be happy with a dot-matrix
printer. In general, dot-matrix printers are noisier, slower, and produce a poorer-quality
image than do laser or inkjet printers, but they are also less expensive. If you need to print
newsletters, brochures, or illustrated reports, you will probably want a high-quality laser
printer. Laser printers cost more than other printers, but they may be worth the price
because they are fast, quiet, and produce high-quality text and graphics.
2 Monitors
The monitor does not do any processing itself. It only displays the information that the
video card tells it to display.
Monitor Sizes
The two most common monitor sizes are 15-inch and 17-inch. If you have an older, hand-
me-down PC or a very inexpensive starter PC, you may have a smaller 14-inch monitor.
21-inch monitors are also available but mostly used by graphics professionals.
3 Scanners
Scanners are peripheral devices used to digitise (convert to electronic format) artwork,
photographs, text, or other items from hard copy. In a sense, a scanner works as a pair of
eyes for your PC. Your eyes see an image and translate the image into electrical impulses
that travel to and are interpreted by your brain. Similarly, a scanner captures images and
converts them to digital data that travel to and are interpreted by the computer. A scanner
works by dividing an image into microscopic rows and columns and measuring, like the
film in a camera, how much light (or lack of it) reflects from each individual intersection
of the rows and columns. Each reflection is recorded as a dot, or picture element (pixel).
After the scanner collects information from each dot, it compiles the result into a digital
file on the computer.
There are a wide variety of scanners that work in a number of different ways, but the
technology behind them is essentially the same. The following sections discuss the more
popular types of scanners available today.
Types of Scanners
D. Flatbed Scanners
Flatbed scanners look and behave a lot like a photocopier. You lay the item to be scanned
on a glass plate and the scanning head passes below the glass.
Flatbed scanners are very versatile: you can scan objects in a variety of sizes and shapes,
including pages from a book, without damaging the original. While flatbed scanners are
the best choice for a wide variety of uses, if you plan to do a lot of text scanning (called
OCR for Optical Character Recognition) work, keep in mind that flatbeds only
accommodate one page at a time. Scanning multi-page documents can be a slow, tedious
process, because you have to manually remove one page and insert the next.
F. Hand Scanners
Hand scanners are a low-cost alternative to their larger, more sophisticated counterparts.
As their name implies, hand scanners are manual devices you move over a flat surface, just
as you do your PC's mouse.
The hand scanner’s advantages are many, but so are its disadvantages. Generally, hand
scanners work best for small, uncomplicated images such as company logos or small black-
and-white photographs. You might want a hand scanner if you do not plan to use it on a
regular basis, because it usually does not require adding internal cards to your CPU, and
it's easily disconnected and stored away. Most hand scanners can only scan a four-inch
wide image at one time and require a steady hand.
You're usually provided with software that helps you “sew up” a series of these 4-inch,
side-by-side scans into one image, but this is obviously not as convenient as getting the full
image at once.
Sound Cards
Sound cards plug into an expansion slot in your PC. The card has a set of connectors that
are exposed on the back of the PC; you can plug a microphone and speakers into the
connectors. Some cards include an optional connector for a line input, which is used to
connect another input source such as the output from a tape player or portable CD player.
Other optional connectors can include a joystick connector and a MIDI connector (for
connecting a MIDI keyboard). The card may include a volume control, which controls the
volume of the speakers and/or headphones.
CHAPTER FIVE
AUXILIARY EQUIPMENT
1 The Air Conditioner
A computer is an electronic machine. It is, therefore, capable of generating heat. A
computer is manufactured to operate in an environment with a specific temperature range.
When the temperature of the environment in which a computer is kept falls outside the
specific range, the computer may function badly and consequently get damaged. The free
air is, basically, dust laden. Dust is metallic in nature and, as such, capable of conducting
electricity. If dust is allowed to settle on a computer, particularly the electronic circuits, the
dust can bridge two circuits. The bridging of two electronic circuits may cause a serious
damage to the computer. Thus, air conditioners are needed in a computer environment to:
• condition the temperature, and
• prevent dust.
2. The Voltage Stabiliser
A computer when switched on, takes off in a cold state, warms up and gradually gets to a
hot state. In a hot state, a computer is always roaming in an attempt to find something to
do. In a situation where the public electricity, such as that of PHCN in Nigeria, is cut
suddenly, the computer would suddenly be brought to a halt. The sudden power cut may
cause the computer to lose the memory of some basic house keeping operations when
power eventually returns and the computer is switched on. The sudden power cut may also
cause irreparable damage to the file the computer was processing at the time the power was
suddenly cut.
2 Operating Systems
An operating system is a program that acts as an interface between a user of a computer
and the computer hardware. The purpose of an operating system is to provide an
environment in which a user may execute programs.
The operating system is the first component of the systems programs that interest us here.
Systems programs are programs written for direct execution on computer hardware in order
to make the power of the computer fully and efficiently accessible to applications
programmers and other computer users. Systems programming is different from
application programming because the former requires an intimate knowledge of the
computer hardware as well as the end users’ needs. Moreover, systems programs are often
large and more complex than application programs, although that is not always the case.
Since systems programs provide the foundation upon which application programs are built,
it is most important that systems programs are reliable, efficient and correct.
In a computer system the hardware provides the basic computing resources. The
applications programs define the way in which these resources are used to solve the
computing problems of the user. The operating system controls and coordinates the use of
the hardware among the various systems programs and application programs for the
various users. The basic resources of a computer system are provided by its hardware,
software and data. The operating system provides the means for the proper use of these
resources in the operation of the computer system. It
simply provides an environment within which other programs can do useful work.
We can view an operating system as a resource allocator. A computer system has many
resources (hardware and software) that may be required to solve a problem: CPU time,
memory space, file storage space, input/output devices, etc.
The operating system acts as the manager of these resources and allocates them to specific
programs and users as necessary for their tasks. Since there may be many, possibly
conflicting, requests for resources, the operating system must decide which requests are
allocated resources to operate the computer system fairly and efficiently. An operating
system is a control program. This program controls the execution of user programs to
prevent errors and improper use of the computer.
Operating systems exist because they are a reasonable way to solve the problem of creating
a usable computing system. The fundamental goal of a computer system is to execute user
programs and solve user problems.
The primary goal of an operating system is convenience for the user. Operating systems
exist because they are supposed to make it easier to compute with an operating system than
without an operating system. This is particularly clear when you look at the operating
system for small personal computers.
A secondary goal is the efficient operation of computer system. This goal is particularly
important for large, shared multi-user systems. Operating systems can attain this goal. It is
known that sometimes these two goals, convenience and efficiency, are contradictory.
While there is no universally agreed definition of the concept of an operating system, we
offer the following as a reasonable starting point: A computer’s operating system (OS) is
a group of programs designed to serve two basic purposes:
• To control the allocation and use of the computing system’s resources among the various
users and tasks.
• To provide an interface between the computer hardware and the programmer that
simplifies and makes feasible the creation, coding, debugging, and maintenance of
application programs. Specifically, we can imagine that an effective operating system
should accomplish all of the following:
• Facilitate creation and modification of program and data files through an editor program.
• Provide access to compilers to translate programs from high-level languages to machine
language.
• Provide a loader program to move the complied program code to the computer’s memory
for execution.
• Provide routines that handle the intricate details of I/O programming.
• Assure that when there are several active processes in the computer, each will get fair
and non-interfering access to the central processing unit for execution.
• Take care of storage and device allocation.
• Provide for long term storage of user information in the form of files.
• Permit system resources to be shared among users when appropriate, and be protected
from unauthorised or mischievous intervention as necessary. Though systems programs
such as editor and translators and the various utility programs (such as sort and file transfer
program) are not usually considered part of the operating system, the operating system is
responsible for providing access to these system resources.
5 File Management
File management is one of the most visible services of an operating system. Computers can
store information in several different physical forms. The magnetic tape, disk, and drum
are the most common forms. Each of these devices has it own characteristics and physical
organisation.
For the convenient use of the computer system, the operating system provides a uniform
logical view of information storage. The operating system abstracts from the physical
properties of its storage devices to define a logical storage unit, the file. Files are mapped,
by the operating system, onto physical devices.
A file is a collection of related information defined by its creator. Commonly, files
represent programs (both source and object forms) and data. Data files may be numeric,
alphabetic or alphanumeric. Files may be free-form, such as text files, or may be rigidly
formatted. In general a file is a sequence of bits, bytes, lines or records whose meaning is
defined by its creator and user. It is a very general concept.
The operating system is responsible for the following activities in connection with file
management:
• The creation and deletion of files
• The creation and deletion of directory
• The support of primitives for manipulating files and directories
• The mapping of files onto disk storage.
• Backup of files on stable (non volatile) storage.
6 Protection System
The various processes in an operating system must be protected from each other’s
activities. For that purpose, various mechanisms are used to ensure that the files, memory
segment, CPU and other resources can be operated on only by those processes that have
gained proper authorisation from the operating system.
For example, memory addressing hardware ensures that a process can only execute within
its own address space. The timer ensures that no process can gain control of the CPU
without relinquishing it. Finally, no process is allowed to do its own I/O, to protect the
integrity of the various peripheral devices.
Protection refers to a mechanism for controlling the access of programs, processes, or users
to the resources defined by a computer controls to be imposed, together with some means
of enforcement.
Protection can improve reliability by detecting latent errors at the interfaces between
component subsystems. Early detection of interface errors can often prevent contamination
of a healthy subsystem by a subsystem that is malfunctioning. An unprotected resource
cannot defend against use (or misuse) by an unauthorised or incompetent user.
7 Networking
A distributed system is a collection of processors that do not share memory or a clock.
Instead, each processor has its own local memory, and the processors communicate with
each other through various communication lines, such as high speed buses or telephone
lines. Distributed systems vary in size and function. They may involve microprocessors,
workstations, minicomputers, and large general purpose computer systems.
The processors in the system are connected through a communication network, which can
be configured in a number of different ways. The network may be fully or partially
connected. The communication network design must consider routing and connection
strategies, and the problems of connection and security. A distributed system provides the
user with access to the various resources the system maintains. Access to a shared resource
allows computation speed-up, data availability, and reliability.
8 Command Interpreter System
One of the most important components of an operating system is its command interpreter.
The command interpreter is the primary interface between the user and the rest of the
system.
Many commands are given to the operating system by control statements. When a new job
is started in a batch system or when a user logs in to a time-shared system, a program which
reads and interprets control statements is automatically executed. This program is variously
called (1) the control card interpreter, (2) the command line interpreter, (3) the shell (in
UNIX), and so on. Its function is quite simple: get the next command statement, and
execute it.
The command statement themselves deal with process management, I/O handling,
secondary storage management, main memory management, file system access, protection,
and networking.
Fig.10: Relationship between the operating system and other components of the
computer system
Language Translators
A programming language is a set of notations in which we express our instructions to the
computer. At the initial stage of computer development, programs were written in machine
language conducting the binary system i.e. 0 and 1. Such programs were hard to write,
read, debug and maintain. In an attempt to solve these problems, other computer languages
were developed. However, computers can run programs written only in machine language.
There is therefore the need to translate programs written in these other languages to
machine language. The suites of languages that translate other languages to machine
language are called language translators. The initial program written in a language different
from machine language is called the source program and its equivalent in machine language
is called object program.
Three examples of classes of language translators are assemblers, interpreters and
compilers.
1. Assemblers: An assembler is a computer program that accepts a source program in
assembly language program and reads and translates the entire program into an equivalent
program in machine language called the object program or object code. Each machine has
its own assembly language, meaning that the assembly language of one machine cannot
run on another machine.
2. Interpreters: An interpreter is a program that accepts program from a source language,
reads, translates and executes it, line by line, into machine language.
3. Compilers: A compiler is a computer program that accepts a source program in one
high-level language, reads and translates the entire user’s program into an equivalent
program in machine language, called the object program or object code. The stages in
compilation include:
• Lexical analysis
• Syntax analysis
• Semantic analysis
• Code generation
For each high-level language, there are different compilers. We can therefore talk of
COBOL Compilers, FORTRAN Compilers, BASIC Compilers, etc. A compiler also
detects syntax errors, that is, errors that arise from the use of the language. Compilers are
portable, i.e. a COBOL Compiler on one machine can run on a different machine with
minimum changes.
Utility Software
This is a set of commonly used programs in data processing departments, also called
service or general-purpose programs. They perform the following operations.
• File Conversion: This covers data transfer from any medium to another, making an exact
copy or simultaneously editing and validating. For example, copying from a hard disk to a
diskette.
• File Copy: It makes an exact copy of a file from one medium to another or from an area
of a medium to another area of the same medium.
• Housekeeping Operations: These include programs to clear areas of storage, writing file
labels and updating common data. They are not involved in solving the problem in hand.
They are operations that must be performed before and after actual processing.
Application Software
Application software is a set of programs designed to solve problems of a specific nature.
It could either be supplied by the computer manufacturer, or in some cases, the users
produce their own application program called user programs. Hence, application software
could be subdivided into two classes, namely; generalized software and userdefined
software.
Under generalised software, we have as examples: Word Processing Programs e.g. Word
Perfect, Word Star, Microsoft Word. Also included are Desktop Publishing e.g. Ventura,
PageMaker, CorelDraw, likewise the Spreadsheet program e.g. LOTUS 1,2,3, Excel,
Super-Q. Under the user-defined, software, we could have some user-defined packages for
a particular company or organisation, for accounting, payroll or some other specialised
purposes.
• The Word Processor: A word processor is used to create, edit, save and print reports. It
affords the opportunity to make amendments before printing is done. During editing a
character, word, sentence or a number of lines can be removed or inserted as the case may
be. Another facility possible is spell checking. A document can be printed as many times
as possible. Word processors are mainly used to produce letters, mailing lists, labels,
greeting cards, business cards, reports, manuals and newsletters. Examples are:
WordPerfect, WordStar, Display Writer, Professional Writer, LOTUS Manuscript, Ms-
Word, LOCO Script and MM Advantage II etc.
• The Spreadsheet: This is an application mainly designed for numerical figures and
reports. Spreadsheets contain columns and rows, in which numbers can be entered. It is
possible to change numbers before printing is done. Other features of spreadsheets are the
ability to use formulas to calculate, use sum and average function, ability to perform
automatic recalculation, and the capacity to display reports in graphical modes. The
spreadsheet is used for budgets, tables, cost analysis, financial reports, tax and statistical
analysis. Examples are: LOTUS 123, Supercalc, MS Multiplan, MS-Excel, VP Planner etc.
• Integrated Packages: They are programs or packages that perform a variety of different
processing operations using data that is compatible with whatever operation is being
carried out. They perform a number of operations like word processing, database
management and spread sheeting. Examples are: Office Writer, Logistic Symphony,
Framework, Enable, Ability, Smart Ware II, and Microsoft Works V2.
• Graphic Packages: These are packages that enable you to bring out images, diagrams
and pictures. Examples are PM, PM Plus, Graphic Writer, Photoshop.
• Database Packages: These are software for designing, setting up and subsequently
managing a database. (A database is an organised collection of data that allows for
modification, taking care of different users view). Examples are Dbase II, III, IV,
FoxBASE, Base Data Perfect, Paradox III, Revelation Advanced and MS-Access.
• Statistical Packages: These are packages that can be used to solve statistical problems,
e.g. Stat Graphical, and SPSS (Statistical Packages for Social Scientists).
• Desktop Publishing: These are packages that can be used to produce books and
documents in standard form. Examples are PageMaker, Ventura, Publishers, Paints Brush,
Xerox Form Base, News Master II, and Dbase Publisher.
• Game Packages: These are packages that contain a lot of games for children and adults.
Examples are Chess, Scrabble, Monopoly, Tune Trivia, Star Trek 2, California Game,
Soccer Game, War Game, Spy Catcher and Dracula in London.
• Communication Packages: Examples are Carbon Plus, Data Talk V3.3, Cross Talk,
SAGE Chit Chat and Data Soft. There are so many packages around, virtually for every
field of study but these are just to mention a few of them. Advantages of these packages
include that they are quicker to and cheaper implement, time saving, minimum time for its
design, they have been tested and proven to be correct, they are usually accompanied by
full documentation, and are also very portable.
User Programs
This is a suite of programs written by programmers for computer users. They are required
for the operation of their individual business or tasks. An example is a payroll package
developed for the salary operation of a particular company.
CHAPTER SEVEN
COMPUTER LANGUAGES
Basically, human beings cannot speak or write in computer language, and since computers
cannot speak or write in human language, an intermediate language had to be devised to
allow people to communicate with the computers. These intermediate languages, known
as programming languages, allow a computer programmer to direct the activities of the
computer. These languages are structured around a unique set of rules that dictate exactly
how a programmer should direct the computer to perform a specific task. With the powers
of reasoning and logic of human beings, there is the capability to accept an instruction and
understand it in many different forms. Since a computer must be programmed to respond
to specific instructions, instructions cannot be given in just any form. Programming
languages standardize the instruction process. The rules of a particular language tell the
programmer how the individual instructions must be structured and what sequence of
words and symbols must be used to form an instruction.
• An operation code
• Some operands.
The operation code tells the computer what to do such as add, subtract, multiply and divide.
The operands tell the computer the data items involved in the operations. The operands in
an instruction may consist= of the actual data that the computer may use to perform an
operation, or the storage address of data.
Some computers use many types of operation codes in their instruction format and may
provide several methods for doing the same thing. Other computers use fewer operation
codes, but have the capacity to perform more than one operation with a single instruction.
There are four basic types of instructions, namely:
(a) input-output instructions;
(b) arithmetic instructions;
(c) branching instructions; and
(d) logic instructions.
An input instruction directs the computer to accept data from a specific input device and
store it in a specific location in the store. An output instruction tells the computer to move
a piece of data from a computer storage location and record it on the output medium. All
of the basic arithmetic operations can be performed by the computer. Since arithmetic
operations involve at least two numbers, an arithmetic operation must include at least two
operands.
Branch instructions cause the computer to alter the sequence of execution of instruction
within the program. There are two basic types of branch instructions; namely unconditional
branch instruction and conditional branch instruction. An unconditional branch instruction
or statement will cause the computer to branch to a statement regardless of the existing
conditions. A conditional branch statement will cause the computer to branch to a statement
only when certain conditions exist.
Logic instructions allow the computer to change the sequence of execution of instruction,
depending on conditions built into the program by the programmer. Typical logic
operations include: shift, compare and test.
Types of Programming Language
The effective utilisation and control of a computer system is primarily through the software
of the system. We note that there are different types of software that can be used to direct
the computer system. System software directs the internal operations of the computer, and
applications software allows the programmer to use the computer to solve user made
problems. The development of programming techniques has become as important to the
advancement of computer science as the developments in hardware technology. More
sophisticated programming techniques and a wider variety of programming languages have
enabled computers to be used in an increasing number of applications.
Programming languages, the primary means of human-computer communication, have
evolved from early stages where programmers entered instructions into the computer in a
language similar to that used in the application. Computer programming languages can be
classified into the following categories:
(a) Machine language
(b) Assembly language
(c) High level symbolic language
(d) Very high level symbolic language
1 Machine Language
The earliest forms of computer programming were carried out by using languages that were
structured according to the computer stored data, that is, in a binary number system.
Programmers had to construct programs that used instructions written in binary notation 1
and 0. Writing programs in this fashion is tedious, time-consuming and susceptible to
errors. Each instruction in a machine language program consists, as mentioned before, of
two parts namely: operation code and operands. An added difficulty in machine language
programming is that the operands of an instruction must tell the computer the storage
address of the data to be processed. The programmer must designate storage locations for
both instructions and data as part of the programming process. Furthermore, the
programmer has to know the location of every switch and register that will be used in
executing the program, and must control their functions by means of instructions in the
program.
A machine language program allows the programmer to take advantage of all the features
and capabilities of the computer system for which it was designed. It is also capable of
producing the most efficient program as far as storage requirements and operating speeds
are concerned. Few programmers today write applications programs in machine language.
A machine language is computer dependent. Thus, an IBM machine language will not run
on NCR machine, DEC machine or ICL machine. A machine language is the First
Generation (computer) Language (IGL).
2 Assembly (Low Level) Language
Since machine language programming proved to be a difficult and tedious task, a symbolic
way of expressing machine language instructions is devised. In assembly language, the
operation code is expressed as a combination of letters rather than binary numbers,
sometimes called mnemonics. This allows the programmer to remember the operations
codes easily than when expressed strictly as binary numbers. The storage address or
location of the operands is expressed as a symbol rather than the actual numeric address.
After the computer has read the program, operations software are used to establish the
actual locations for each piece of data used by the program. The most popular assembly
language is the IBM Assembly Language. Because the computer understands and executes
only machine language programs, the assembly language program must be translated into
a machine language. This is accomplished by using a system software program called an
assembler. The assembler accepts an assembly language program and produces a machine
language program that the computer can actually execute. Although, assembly language
programming offers an improvement over machine language programming, it is still an
arduous task, requiring the programmer to write programs based on particular computer
operation codes. An assembly language program developed and run on IBM computers
would fail to run on ICL computers. Consequently, the portability of computer programs
in a computer installation to another computer installation which houses different makes
or types of computers were not possible. The low level languages are, generally, described
as Second Generation (Computer) Language (2GL).
The very high level language generally described as the Fourth Generation (computer)
Language (4GL), is an ill-defined term that refers to software intended to help computer
users or computer programmers to develop their own application programs more quickly
and cheaply. A 4GL, by using a menu system for example, allows users to specify what
they require, rather than describe the procedures by which these requirements are met. The
detailed procedure by which the requirements are met is done by the 4GL software which
is transparent to the users.
A 4GL offers the user an English-like set of commands and simple control structures in
which to specify general data processing or numerical operations. A program is translated
into a conventional high level language such as COBOL, which is passed to a compiler. A
4GL is, therefore, a non-procedural language. The program flows are not designed by the
programmer but by the fourth generation software itself. Each user request is for a result
rather than a procedure to obtain the result.
CHAPTER EIGHT
BASIC PRINCIPLES OF COMPUTER PROGRAMMING
Problem Solving With the Computer
The computer is a general-purpose machine with a remarkable ability to process
information. It has many capabilities, and its specific function at any particular time is
determined by the user. This depends on the program loaded into the computer memory
being utilised by the user.
There are many types of computer programs. However, the programs designed to convert
the general-purpose computer into a tool for a specific task or applications are called
“Application programs”. These are developed by users to solve their peculiar data
processing problems.
Computer programming is the act of writing a program which a computer can execute to
produce the desired result. A program is a series of instructions assembled to enable the
computer to carry out a specified procedure. A computer program is the sequence of simple
instructions into which a given problem is reduced and which is in a form the computer
can understand, either directly or after interpretation.
Programming Methodology
Principles of Good Programming
It is generally accepted that a good computer program should have the characteristics
shown below:
• Accuracy: The program must do what it is supposed to do correctly and must meet the
criteria laid down in its specification.
• Reliability: The program must always do what it is supposed to do, and never crash.
• Efficiency: Optimal utilisation of resources is essential. The program must use the
available storage space and other resources in such as way that the system speed is not
wasted.
• Robustness: The program should cope with invalid data and not stop without an
indication of the cause of the source of error.
• Usability: The program must be easy enough to use and be well documented.
• Maintainability: The program must be easy to amend, having good structuring and
documentation.
• Readability: The code of a program must be well laid out and explained with comments.
Stages of Programming
The preparation of a computer program involves a set of procedure.
These steps can be classified into eight major stages, viz
(i) Problem definition
(ii) Devising the method of solution
(iii) Developing the method using suitable aids, e.g. pseudo code or flowchart.
(iv) Writing the instructions in a programming language
(v) Transcribing the instructions into “machine sensible” form
(vi) Debugging the program
(vii) Testing the program
(viii) Documenting all the work involved in producing the program.
(i) Problem definition
The first stage requires a good understanding of the problem. The programmer (i.e. the
person writing the program) needs to thoroughly understand what is required of a problem.
A complete and precise unambiguous statement of the problem to be solved must be stated.
This will entail the detailed specification which lays down the input, processes and output
required.
(ii) Devising the method of solution
The second stage involved is spelling out the detailed algorithm. The use of a computer to
solve problems (be it scientific or business data processing problems) requires that a
procedure or an algorithm be developed for the computer to follow in solving the problem.
(iii) Developing the method of solution
There are several methods for representing or developing methods used in solving a
problem. Examples of such methods are: algorithms, flowcharts, pseudo code, and decision
tables.
(iv) Writing the instructions in a programming language
After outlining the method of solving the problem, a proper understanding of the syntax of
the programming language to be used is necessary in order to write the series of instructions
required to get the problem solved.
(v) Transcribing the instructions into machine sensible form
After the program is coded, it is converted into machine sensible form or machine
language. There are some manufacturers written programs that translate users programs
(source programs) into machine language (object code). These are called translators and
instructions that machines can execute at a go, while interpreters accept a program and
execute it line-by-line.
During translation, the translator carries out syntax check on the source program to detect
errors that may arise from wrong use of the programming language.
(vi) Program debugging
A program seldomly executes successfully the first time. It normally contains a few errors
(bugs). Debugging is the process of locating and correcting errors. There are three classes
of errors.
• Syntax errors: Caused by mistake coding (illegal use of a feature of the programming
language).
• Logic errors: Caused by faulty logic in the design of the program. The program will
work but not as intended.
• Execution errors: The program works as intended but illegal input or other
circumstances at run-time makes the program stop.
There are two basic levels of debugging. The first level called desk checking or dry running
is performed after the program has been coded and entered or key punched. Its purpose is
to locate and remove as many logical and clerical errors as possible. The program is then
read (or loaded) into the computer and processed by a language translator. The function of
the translator is to convert the program statements into the binary code of the computer
called the object code. As part of the translation process, the program statements are
examined to verify that they have been coded correctly, if errors are detected, a series of
diagnostics referred to as an error message list is generated by the language translator. With
this list in the hand of the programmer, the second level of debugging is reached. The error
message list helps the programmer to find the cause of errors and make the necessary
corrections. At this point, the program may contain entering errors, as well as clerical errors
or logic errors. The programming language manual will be very useful at this stage of
program development.
After corrections have been made, the program is again read into the computer and again
processed by the language translator. This is repeated over and over again until the program
is error-free.
(vii) Program testing
The purpose of testing is to determine whether a program consistently produces correct or
expected results. A program is normally tested by executing it with a given set of input
data (called test data), for which correct results are known.
For effective testing of a program, the testing procedure is broken into three segments.
a. The program is tested with inputs that one would normally expect for an execution of
the program.
b. Valid but slightly abnormal data is injected (used) to determine the capabilities of the
program to cope with exceptions. For example, minimum and maximum values allowable
for a sales amount field may be provided as input to verify that the program
processed them correctly.
c. Invalid data is inserted to test the program’s error-handling routines. If the result of the
testing is not adequate, then minor logic errors still abound in the program. The
programmer can use any of these three alternatives to locate the bugs.
Other methods of testing a program for correctness include:
• Manual walk-through: The programmer traces the processing steps manually to find
the errors, pretending to be the computer, following the execution of each statement in the
program, noting whether or not the expected results are produced.
• Use of tracing routines: If this is available for the language, this is similar to (1) above
but is carried out by the computer; hence it takes less time and is not susceptible to human
error.
• Storage dump: This is the printout of the contents of the computer’s storage locations.
By examining the contents of the various locations, when the program is halted, the
instruction at which the program is halted can be determined. This is an important clue to
finding the error that caused the halt.
• Program documentation: Documentation of the program should be developed at every
stage of the programming cycle.
The following are documentations that should be done for each program.
(a) Problem Definition Step
• A clear statement of the problem
• The objectives of the program (what the program is to accomplish)
• Source of request for the program.
• Person/official authorising the request
(b) Planning the Solution Step
• Flowchart, pseudo code or decision tables
• Program narrative
• Descriptive of input, and file formats
(c) Program source coding sheet
(d) User’s manual to aid persons who are not familiar with the program to apply it correctly.
The manual it contains a description of the program and what it is designed to achieve.
(e) Operator’s manual to assist the computer operator to successfully run the program. This
manual contains:
(i) Instructions about starting, running and terminating the program.
(ii) Message that may be printed on the console or VDU (terminal) and their meanings.
(iii) Setup and take down instruction for files.
Advantages of Program Documentation
a. It provides all necessary information for anyone who comes in contact with the program.
b. It helps the supervisor in determining the program’s purpose, how long the program will
be useful and future revision that may be necessary.
c. It simplifies program maintenance (revision or updating).
d. It provides information as to the use of the program to those unfamiliar with it.
e. It provides operating instructions to the computer operator.
CHAPTER NINE
FLOWCHARTS AND ALGORITHMS
A flowchart is a graphical representation of the major steps of work in process. It displays
in separate boxes the essential steps of the program and shows by means of arrows the
directions of information flow. The boxes, most often referred to as illustrative symbols,
may represent documents, machines or actions taken during the process. The area of
concentration is on where or who does what, rather than on how it is done. A flowchart can
also be said to be a graphical representation of an algorithm, that is, it is a visual picture
which gives the steps of an algorithm and also the flow of control between the various
steps.
3.6 Pseudocodes
A pseudocode is a program design aid that serves the function of a flowchart in expressing
the detailed logic of a program. Sometimes a program flowchart might be inadequate for
expressing the control flow and logic of a program. By using Pseudocodes, program
algorithms can be expressed as English-language statements. These statements can be used
both as a guide when coding the program in a specific language and as documentation for
review by others. Because there is no rigid rule for constructing pseudocodes, the logic of
the program can be expressed in a manner that does not conform to any particular
programming language. A series of structured words is used to express the major program
functions. These structured words are the basis for writing programs using a technical term
called “structure programming”.
In addition to payroll preparation, the computer is also used for other routine and repetitive
book keeping and accounting operations involving recording, classifying and summarising
accounting data. This may involve preparing and updating ledger and journal accounts,
invoicing, accounts receivable and payable. Other operations may also include
updating and preparing accounts on sales, purchases and inventory. The computer is also
used for the preparation and evaluation of the balance sheet and statements of accounts
and, preparation of dividends and summary accounts for shareholders and management.
(ii) Inventory Control
An equally important business application of the computer is seen in the execution of the
important business function involved in maintaining a desirable level of inventory in a
business organisation. This is to ensure that working capital is not unduly tied in stocks
while at the same time available stocks can meet the demands of continued production
processes. In this direction, the computer is used as a tool in updating records of inventory
and also in the preparation of forecasts and demand predictions based on economic order
quantity analysis and other forecasting techniques.
(iii) Auditing Operations
The computer is used as a tool by auditors to report accurately on the transaction register
which constitutes the most crucial aspect in the audit trail. With the aid of the computer, it
is easier for auditors, in their examination of the accounting records of a business, to trace
routine business operations so that variances can be detected and verified accurately using
various computer audit packages.
(iv) Management Information System
An equally challenging and revolutionary application of the computer in business is the
important role the computer-based Management Information System (MIS) is playing in
management decision making. The computer is used as a tool for the online storage,
retrieval, processing and maintenance of corporate data meant to be shared by all the users’
departments.
A Management Information System involves a computerised system of data processing
procedures which are integrated in an organisation to provide accurate, complete, concise,
timely and effective data which management can use at various levels of decision making
for planning, organising, directing, controlling and monitoring procedures. Included in
Management Information System to be used for the various decision making procedures
are a number of systems comprising:
• Controlling and operational planning support systems to deal with day-to-day decisions
involving routine processing and transaction procedures.
• Tactical support systems to deal with short-run and middle level management decisions.
• Strategic support systems to deal with corporate strategic and top level management
decisions.
With the aid of these support systems, data can be retrieved and analysed on a continuous
and timely basis to aid management decision making and other management functions
about sales, finances, purchases, acquisition of plant and equipment, research, market
analysis and so on.
CHAPTER TWELVE
COMPUTER APPLICATIONS IN GOVERNMENT, SCIENCE,
ENGINEERING, TRANSPORT, COMMUNICATIONS, RECREATION
AND THE MILITARY
Computers are commonly used to find accurate solutions to both scientific and engineering
problems. Weather forecasting has now become a daily activity to which the computer has
proved very useful in providing information on the kind of weather we are likely to expect
over a period of time. Such accurate predictions help the farmers, airline operators,
navigators and other activities which depend on the weather for their operations. Computer
aided critical path study is used to monitor the optimum and efficient use of time, money,
material and human resources in the execution and implementation of projects. Such
critical path study is used successfully in various projects, for example, the construction of
roads, bridges, buildings, manufacturing, the conduct of elections and sales campaigns.
Another scientific application of in computer is the monitoring and simulation modelling
techniques, to provide indicators as to how systems such as the human body, economy,
weather, demographic variables and so on react to changes in situations. The application
of simulation techniques helps in taking decisions and precautions in advance, in case there
are repercussions help when the desired changes are introduced in practical situations.
Computers also help to design buildings, roads, bridges, vehicles, aeroplanes, ships and
complex architectural, works computer. Prototyping is increasingly being used in the
construction of systems to minimise the financial losses in real life situations.
The computer is also used to find solutions to very complex mathematical and statistical
computations at incredible speeds and accuracy. Furthermore, various software packages
are now increasingly being developed to analyse surveyed data, construct live tables,
perform mortality demographic and other multivariate data analysis designed to
revolutionise scientific research and to find practical solutions to complex, challenging and
everyday life situations. We now outline the use of the computer in the following specific
areas, among others.
1 Marketing Departments
(a) Comparative analysis of products of two or more companies with a view to predicting
some areas of improvement.
(b) Market survey, statistical analysis of proportional market gains and prediction of new
market areas.
(c) Creation of consumer awareness and appreciation of products.
3.3 Agriculture
(a) Keeping records of soil, rainfall, weather conditions, land size, crops, and chemicals
and ultimately processing the records to estimate soil fertility and yield per hectare over a
number of years.
(b) Keeping records, of poultry and animal husbandry farm with a view to estimating the
feed mix and environmental conditions desirable for optimal yield.
(c) Assessing the behaviour patterns of farmers in a cooperative venture, and assisting in
matching the farmers that have identical behaviour with a view to optimizing their
productivity.
Government
The business of governance is serious business. In a multi-cultural, multilingual, multi-
ethnic, setting such as Nigeria, a lot of complex and often conflicting variables interplay or
are taken into consideration before a broad-based decision can be taken. Computers can
assist government business in the following ways:
(a) Planning
(b) Decision marking
(c) Policy formulation
(d) Monitoring and control of operations
The availability of data, timely access to the data and timely reporting on the data are very
crucial to the above listed business of government.
Computers can be used to:
(a) Keep accurate records of government assets and periodically estimate the market value
and insurance value.
(b) Keep accurate records of the population, behaviour patterns, and consumption patterns
of utilities, and estimate the distribution of basic needs such as electricity, water, telephone
and postal services.
(c) Keep records of government revenue and expenditure and assist government in
monitoring, controlling and evaluating the revenue and expenditure.
(d) Keep records of government employees with a view to:
(i) Preventing ghost workers
(ii) Estimating the strength of the human resources of government
(iii) Producing statistical data on employees
(e) Issue identity cards to the citizens.
(f) Compile a broad-based and accurate voters register. This will check the incidence of
ghost voting, multiple voting and other electoral malpractices, which have be devilled the
electoral processes and stable polity in third world countries.
(g) Keep track of crime in society, thereby helping government security agencies to check
crime.
(h) Maintain the database of the mineral resources and other resources of the nation.
The Military
One of the areas in which the computer has been applied intensively and extensively is the
military. The first generation of the modern computers were designed and used during the
First and Second World Wars. The use of computers for processing data became more
popular during these periods due to the need to procure, store and process large volumes
of data. Over the years, the use of computers has transcended the traditional role of
“crunching numbers” to sophisticated applications.
Specifically, computers are being used in the following ways, in military operations:
• Training the personnel through the use of simulated war situations.
• Reconnaissance surveys.
• Automatic detection of mines.
• Monitoring and tracking of planes with a view to bringing down any unauthorised plane
flying in the nation’s airspace.
• Monitoring operations in the military base.
• Launching of missiles from distant military bases to the enemy
territory. Such missiles are programmed to ensure that only the desired targets are hit.
• Manufacture of state-of-the-art military hardware and consumables.
• Communication and transmission of highly coded classified military information.
• Military games, adventures and expeditions.
• Keeping records of military personnel and logistics.
• Keeping records of military assets – hardware
• Management of military stock with a view to maintaining warready stock of materials,
ammunition and assets at any point in time.
• Monitoring the environmental and storage conditions of lethar weapons in order to
prevent accidents, like sudden explosions caused by improper storage.
• Generation and maintenance of necessary data that would enhance planning, policy
formulation, decision making and forecast.
CHAPTER THIRTEEN
COMPUTER VIRUS
One of the biggest fears of having computers is viruses. Viruses are malicious programs
designed entirely for destruction and havoc. Viruses are created by people who either know
a lot about programming or know a lot about computers.
Computer virus is one of the greatest threats to computers and computer applications.
Once the virus is made, it is generally distributed through shareware, pirated software, e-
mail or other various ways of transporting data. Once the virus infects someone's computer
it will either start infecting other data, destroying data, overwriting data, or corrupting
software. The reason these programs are called viruses is that they spread like human
viruses. Once your PC has become infected, either by downloading something from the
Internet or sharing software, any disks or writeable media that you place into the computer
will then be infected. When that disk is put into another computer, the computer is also
infected. And if the user puts files on the Internet, and hundreds of people download those
files, they will all be infected, and the process will continue infecting thousands if not
millions of computers.
Virus Properties
Your computer can be infected even if files are just copied: Because some viruses are
memory resident, as soon as a diskette or program is loaded into memory, the virus attaches
itself into memory.
Viruses can be polymorphic: Some viruses have the capability of modifying their code,
which means one virus could have various amounts of similar variants.
Viruses can be memory/Non memory resident: Depending on the type, a virus can be a
memory resident virus type, which first attaches itself into memory and then infects the
computer. The virus can also be Non memory resident, which means a program must be
run in order to infect the computer.
A virus can be a stealth virus: Stealth viruses first attach themselves to files on the
computer, and then attack the computer. This causes the virus to spread more rapidly.
Viruses can carry other viruses and infect a system, and infect with the other viruses
as well: Because viruses are generally written by different individuals and do not infect the
same locations of memory and or files, this could mean that multiple viruses can be stored
in one file, diskette or computer.
Viruses can make the system never show outward signs: Some viruses will hide changes
made, such as when infecting a file, the file will stay the same size.
Viruses can stay on the computer even if the computer is formatted:
Viruses have the capability of infecting different portions of the computer such as the
CMOS battery or master.
How Viruses May Infect Files
Viruses can infect any files, however they usually attack .com, .exe, .sys, .bin, .pif or any
data files. Viruses have the capability of infecting any file. However they will generally
infect executable files or data files such as Word or Excel documents which are opened
frequently.
Viruses can increase the file’s size; however this can be hidden:
When infecting files, viruses will generally increase the size of the file. However with more
sophisticated viruses, these changes can be hidden.
Viruses can delete files as the files are run: Because most files are loaded into memory
and then run once the program is in memory, the virus can delete the file.
Viruses can corrupt files randomly: Some destructive viruses are not designed to destroy
random data but instead randomly delete or corrupt files.
Viruses can cause write protect errors when executing .exe files from a write
protected disk: Viruses may need to write themselves to files which are executed. Because
of this, if a diskette is write protected, you may receive a write protection error.
Viruses can convert .exe files to .com files: Viruses may use a separate file to run the
program and rename the original file to another extension, so the .exe is run before the
.com.
Viruses can reboot the computer when a file is run: Various computers may be designed
to reboot the computer when run.
Detecting Viruses
The most commonly used method of protecting against and detecting viruses is to purchase
a third party application designed to scan for all types of viruses. Alternatively, a user can
look at various aspects of the computer and detect possible signs indicating a virus is on
the computer. While this method can be used to determine some viruses, it cannot clean or
determine the exact virus you may or may not have.
REFERENCES
Akinyokun, O.C. (1999). Principles and Practice of Computing Technology. Ibadan:
International Publishers Limited.
Balogun, V.F., Daramola, O.A. Obe, O.O. Ojokoh, B.A., and Oluwadare S.A. (2006).
Introduction to Computing: A Practical Approach. Akure: Tom- Ray Publications.