ICT Notes 2020
ICT Notes 2020
Computers range from very small to very large machines with some capable of doing Definition: A computer generation is an era or period in the history of computers in which the
millions of calculations in a single second, while others may take long periods of time to do computer was characterized by a major technological development that fundamentally
even the most simple calculations. changed the way computers operate.
1
2.3. Third Generation (1956-1980) ATMs are known by various other names including automatic/automated banking machine
Third generation computers were designed with the use of integrated circuits (ICs). (ABM), automated transaction machine and cashpoint.
Integrated circuits made it possible to embed a large number of transistors into very small
surface area of silicon known as chip. Instead of punched cards and printouts, users 3.1.2. Stock Control Systems
interacted with third generation computers through keyboards and monitors and The collection of items that a business manufactures or sells is called stock. In a shop for
interfaced with an operating system, which allowed the device to run many different example, the stock includes all of the items on the shelves and out the back in the
applications at one time with a central program that monitored the memory. Computers for storeroom.
the first time became accessible to a mass audience because they were smaller and cheaper It is important that a business does not keep too much stock or too little stock. This is
than their predecessors. because:
Too much stock costs money as you have to store it all somewhere
2.4. Fourth Generation Too much perishable stock (e.g. food) means that it may go bad before it is sold
The microprocessor brought the fourth generation of computers, as thousands of Too little stock means that you might run out of stock before the next delivery
integrated circuits were built onto a single silicon chip. What in the first generation filled an arrives
entire room could now fit in the palm of the hand. As these small computers became more
powerful, they could be linked together to form networks, which eventually led to the Definition: A stock control system is basically a database that keeps track of stock and
development of the Internet. Fourth generation computers also saw the development of informs users of when to re-order along with helpful sales reports.
GUIs, the mouse and handheld devices.
When items are sold or delivered, their codesare input to the system either manually or
2.5. Fifth Generation (1980 - present) using a point-of-sale terminal (barcode scanner or similar technology). The database
Till fourth generation computers, the main stress was on hardware technology. Fourth matches the codes with the items’ names and prices, prints an itemized bill and uses the
generation computers are faster, more accurate, reliable, smaller in size and very cheap, data to update stock levels. It also updatesa sales file which can be used there and then to
still they lack thinking power. Fifth generation computing devices are based on artificial calculate all sorts of statistics.
intelligence. Artificial intelligence will give computers thinking power and capability to Stock control systems make it very easy for stock levels to be monitored, and for stock to be
make decisions like human beings. They are still in development though there are some reordered when it is running low.
applications, such as voice recognition, that are being used today.
3.1.3. EFTPOS Systems
3. Applications of Computers EFTPOS stands for Electronic Fund Transfer at the Point Of Sale. It is a system that
Computers are fast becoming our way of life and one cannot imagine life without combines a business’ stock control system (EPOS) with an electronic fund transfer system,
computers in today’s world. Their importance can be attributed to the fact that almost thereby enabling the business to conduct financial transactions electronically. It allows
every sphere of our life is affected. We find their applications particularly in fields where individuals to pay for goods using credit or debit cards.
computations are required to be done at a very fast speed and where data is so complicated To pay for goods, a customer inserts their debit or credit card into a terminal device and
that the human brain finds it difficult to cope up with. type in a PIN number to verify that it is their card.The system electronically contacts their
bank to check that the card is valid and hasn't been stolen and also that there is enough
3.1. Commercial and General Data Processing Systems fund in their account to pay for the goods. Once payment has been authorized by the bank,
3.1.1. ATM Systems money is removed from the customer’s account and electronically paid into the shop's
ATM stands for Automatic/Automated Teller Machine. Itis a machine that is connected to a account.
bank’s computer system that provides the bank’s customers with access to financial
transactions in a public space without the need for a cashier, human clerk or bank teller. 3.1.4. Reservation Systems
The ATM can be used by the customers to make cash withdrawals, credit card advances or A computer reservation system or central reservation system is a computerized system
check their account balances. used to store and retrieve information and conduct transactions related to air travel, hotels,
On most modern ATM systems, a customer is identified by inserting a plastic ATM card car rental, or activities. They allow users to book hotel rooms, buy airline tickets, rent cars,
with a magnetic stripe or a plastic smart card with a chip, which contains a unique card etc. They also provide access to railway reservations and bus reservations in some
number and some security information. Authentication is provided by the customer markets, although these are not always integrated with the main system.
entering a personal identification number (PIN). Upon successful entry of the PIN, the
customer may perform a transaction.
5.2. The ComputerMisuse Act Assignment: State what you understand by the following terms.
This act makes it an offence to access any computer to which you do not have an authorized i) Digital inclusion
right to use. It introduces three criminal offences: ii) Digital divide.
1. Unauthorized access to computer material.
2. Unauthorized access with intent to commit or facilitate commission of further Answer:
offences. i) Digital inclusion
3. Unauthorized modification of computer material. Digital inclusion is commonly defined asthe incorporation of information technologies into
the community in order to promote education and improve the quality of life.
5.3. Copyright, Design and Patent Act In other words, it is the ability of individuals and groups to access and use information and
This Act is designed to protect all types of intellectual property and ensure that authors or communication technologies.
creators of a piece of work receive both credit and compensation. Digital inclusion is necessary as we move towards a technology based society to ensure that
all individuals can participate fully in the economic, educational, civic and social activities of
Copyright is a statutory grant that protects original work. Something that is their community.
copyrighted is not to be reproduced, published or copied without permission from
the copyright holder. Ideas are not protected by copyright; only the specific ii) Digital divide
presentation of the idea is copyrightable. The Digital divide refers to the gap between those who have and those who lack access to
computers and the Internet.
Design is the appearance or construction of something. A design is not immediately
protected.Itmust be registered with the appropriate institution, 6. Computers in the Workplace
It is important to note that in as much as the computer is a very vital tool for everyone’s
A Patent is a grant to inventors that give them exclusive monopoly over their daily use, it can also be a very harmful tool if poorly used. Using the computer for
invention. It gives them the right to stop others from producing, selling or using prolonged periods of time can lead to physical health risks. For this reason, users must
their invention. Unlike copyrights, patents protect the ideas or design of the ensure that they follow health measures and apply safety precautions as they use the
invention rather than any tangible form of the invention. computers to avoid computer related disorders.
c. Placement of components
Placing components e.g. mouse, telephone, far away from you can cause you to repeatedly
reach out for them resulting in strain on the shoulder, arm and neck. III. COMPUTER ORGANISATION AND ARCHITECTURE
Storage Unit Drag and drop can be used to move files or documents from one place to another.
A mouse connects to a computer through PS/2 cable (PS/2 mouse), USB cable (USB
Functional Units of a Computer mouse), or wireless (optical mouse).
1.1.3. Scanner
Assignment: What is the difference between a computer with a Von Neumann’s architecture A scanner is an optical device that converts hardcopy image or text into digital form so that
and one with a Harvard architecture? it can be fed into the computer. The common optical scanner devices are the flatbed
scanner, optical mark reader, optical character reader and barcode reader.
1.1. Input Devices Flatbed Scanner: a scanner in which the object to be scanned is held flat against a
Input devices are hardware components that are used to enter data and instructions into piece of glass.
the computer. Examples are keyboard, mouse, scanner, joystick, light pen, touchpad, Optical Mark Reader
trackball and microphone. Optical Character Reader
Barcode Reader
Other types of input devices are joystick, light-pen, trackball and touch pad.
Dynamic RAM (DRAM) consists of capacitors that slowly leak their charge over time.
Thus, they must be refreshed every few milliseconds to prevent data loss. DRAM is
The Instruction Cycle
cheap memory owing to its simple design.
Steps 1 and 2 together are called instruction time or I-time and steps 3 and 4 together are
called execution time or E-time. The combination of I-time and E-time is called the machine Static RAM (SRAM) consists of circuits that retain their charge over time. SRAM is
or instruction cycle or the fetch-decode-execute cycle. The length of time taken to fetch, faster and more expensive than dynamic RAM, and does not need to be refreshed as
decode and execute an instruction is measured in clock cycles. DRAM does. Due to its cost it is not used as main memory but rather to build cache
memory.
1.3.5. System Clock
The CPU has a small quartz crystal circuit called the system clock that controls the timing of b. Read Only Memory
all computer operations. The system clock generates regular electronic pulses, or ticks, that Read only memory (ROM) is a kind of memory whose contents can only be read by the
set the operating pace of components of the system unit. Each tick is known as clock cycle computer. Data found in ROM is written by the manufacturer and cannot be modified by
and the pace of the system clock is called clock speed. Clock speed is measured in the user. ROM is useful for holding data that never changes like the “boot” or start-up
megahertz (Mhz) or gigahertz (Ghz) and refers to the number of clock cycles per second program which is run when the computer is switched on.ROM is non-volatile meaning that
that the CPU runs at. Mega and giga stand for million and billion respectively while hertz its content is preserved even without power. There are four types of ROM:
means cycles per second. Thus,1Ghz means one billion cycles per second. A computer that
operates at 3 Ghz has 3 billion (giga) clock cycles in one second (hertz). Masked ROM isROM programmed with its data when the chip is fabricated.
The faster the clock speed, the more instructions the processor can execute per second. Programmable ROM(PROM) isROM that can be programmed once but not
The speed of the system clock has no effect on devices such as a printer or disk drive. The reprogrammed.
speed of the system clock is just one factor that influences a computer’s performance. Erasable Programmable ROM (EPROM) is ROM that can be erased by strong
Other factors, such as the type of processor chip, amount of cache, memory access time, bus ultraviolet light and new data burnt into it. To do this the chip has to be removed
width, and bus clock speed. from the machine and put back after the changes have been made.
Electrically Erasable Programmable ROM (EEPROM) isROM whose content can be
1.4. Storage Devices erased electrically. In this case, the chip need not be removed from the machine. The
Storage devices are computer components that hold programs and data for use in the programming is done using special software.
computer. Programs and data can be made available for initial or additional processing
when required.A storage device is made of two parts: the storage medium and the device. c. Cache Memory
The medium is the surface or substrate that holds actual data Cache memory is a smaller and faster memory between the CPU and main memory, which
The device reads information from or stores information onto the medium stores copies of data from the most frequently accessed memory locations. The purpose of
cache memory is to speed up accesses by storing recently used data closer to the CPU,
Computer storage can be classified basically into two: primary storage and secondary instead of storing it in main memory. Cache is static RAM and is usually organized in levels:
storage. Level 1 (L1) cache, Level 2 and Level 3 cache.
Level 1 cache is closest to the CPU or within it.
When the CPU needs to access memory, cache memory is examined first. If the data is
found in cache, it is read from it. Otherwise, main memory is accessed. When the CPU refers
to memory and finds the data in cache, it is said to be a HIT. Otherwise, it is a MISS.
Registers
a. The Data Bus
Cache Memory The data bus carries data between the CPU and main memory or peripherals. During a
write operation, data is carried from the CPU and during a read operation, data is carried
Faster and Main Memory
Slower and into the CPU. This means that the data bus is bidirectional. The size of the data us
smaller in size
Magnetic Disk larger in size determines how much data can be transferred in a single operation.
Optical Disc/Solid State Devices
b. The Address Bus
Magnetic Tape The address bus carries address information from the CPU to main memory or peripherals.
It is unidirectional. The CPU uses the address bus to send the address of the memory
Memory hierarchy location to be written to or read from. Also, when the CPU reads data from or writes to a
port, it sends the port address out on the address bus. The size of the addressbus
1.5. The Motherboard determines the maximum amount of main memory (RAM) that can be addressed. A
The motherboard is the main printed circuit board in the computer which holds the chipset computer with a 32 bit bus size can address a maximum RAM of 232 bits = 4GB.
and other electronic components that give function to the computer. The motherboard is
indispensable to the computer and provides the main computing capability. c. The Control Bus
The control bus is used by the CPU to send out signals to enable the outputs of addressed
memory devices or port devices. Typical control bus signals are memory read, memory
write, I/O read and I/O write.
When the CPU wants to read data from a memory location, it sends out the memory
address of the desired data on the address bus and then sends out a Memory Read signal on
the control bus. The memory read signal enables the addressed memory device to output
the data onto the data bus. The data from the memory travels along the data bus to the CPU.
1.5.3. Input/OutputInterfaces
The Motherboard The CPU communicates with I/O devices through bus interfaces connected to the system
bus. These bus interfaces also called expansion busesare then connected to ports which
2 3. Processor Architecture
Control Unit 2 PE 2
A processor’s architecture refers to the way in which its memory and control are organized.
Control Unit n PE
3.1. Instruction Set Architecture
IS = Instruction Stream
PE = Processor Element Every CPU on the market today has a predefined instruction set which defines the primitive
Data operations that can be performed by thatCPU.
Memory
Stream
Definition: An instruction set is the collection of bit patterns or binary codes for the machine
MISD Architecture operations that a processor has been designed to perform.
An instruction set architecture (ISA) is the interface between the computer's software and
2.4. Multiple Data, Multiple Instruction Stream hardware and also can be viewed as the programmer's view of the machine. Besides
MIMD machines are multiprocessor machines capable of executing multiple instructions on instructions, it defines items in the computer that are available to a program - e.g. data
multiple data sets. They have n processors, n streams of instructions and n streams of types, registers, addressing modes, and memory.
data.Each processor element in this model has a separate instruction stream and data There are two types of fundamental CPU architectures based on the notion of instruction
stream hence such machines are well suited for any kind of application. Examples of MIMD set: complex instruction set computers and reduced instruction set computers.
machines include multi-core computers like the Blue Gene, Fujitsu K computer and CRAY
Jaguar. 3.1.1. Complex Instruction Set Computer(CISC)
CISC (pronounced sisk) is a CPU design with a large amount of different and complex
IS 1 DS1
Control Unit 1 PE 1 instructions. In CISC processors, the control unit contains a number of micro-electronic
circuitry to generate a set of control signals and each micro-circuitry is activated by a
IS 2 DS 2 microcode. Complex instructions are first decoded and the corresponding microcode
Control Unit 2 PE 2 DS = Data Stream
routine dispatched to the execution unit.
IS = Instruction Stream
IS
The standard features of CISC processors are:
ControlUnit PE n DS n
a large number of different and complex instructions.
the use of complex addressing modes.
execution of different machine programs on a CISC machine.
Memory
the use micro-program control unit.
limited number of registers.
MIMD Architecture
variable length instruction encoding
direct memory access
Assignment: SIMD, MISD and MIMD machines are known as parallel processing machines.
What do you understand by parallel processing? Examples of CISC processors are: Intel 386, 486, Pentium, Pentium Pro, Pentium II,
Pentium III, Motorola’s 68000, 68020, 68040, etc.
Answer: Parallel processing is the use of multiple (independent) processors simultaneously to
execute a single program or task. 3.1.2. Reduced Instruction Set Computers (RSIC)
Parallel processing divides a single problem into portions so that multiple processors work on RISC(pronounced risk) is a CPU design with a small number of basic and simple machine
their assigned portion of the problem at the same time. Parallel processing requires special language instructions, from which more complex instructions can be composed. RISC
software that recognizes how to divide the problem and then bring the results back together instructions are hardwired. That is, they are built into the chip with hardware rather than
again.
Introduction a. OS Kernel
A computer system is basically made up of hardware and software. Hardware refers to the The kernel is the central part of an operating system that is running at all times on the
physical components of the computer. They are the parts of the computer that can actually computer. It loads first and remains in memory as long as the computer is on. It consists of
be seen and touched like the keyboard, mouse, monitor and internal circuits.Software on utilities (file manager, memory manager, device drivers, process manager etc.) that
the other hand, refers to the collection of computer programs and data that run on a perform basic required functions. In many operating systems, only the kernel can access
computer, and which make the hardware useful. They are the intangible components of the hardware directly.
computer system.
Computer software has two major categories namely system software and application b. Command Interpreter
software. The command interpreter (processor) is the part of the operating system that understands
and executes commands that are entered interactively by a human being or from a
1. System Software program.In some operating systems the command interpreter is called shell.It provides an
System software control and coordinate computer resources (hardware and operations) so interface between users and the operating system (kernel).When a user logs in, a shell is
that the computer user and applications can smoothly interact. They help the computer started up.
carry out its basic operating tasks. System software are designed to perform computer
related tasks. They include operating systems, firmware, utility programs, device drivers, c. SystemCalls
library programs and language translators. The interface between the OS and the user program is defined by a set of instructions called
system calls. User programs use system calls to talk with the operating system.
1.1. The Operating System
The operating system is the essential software that is required for a computer to become Definition: System call is the mechanism by which a program requests a service from the
operational. Itis the software layer that is on top of the hardware to provide functionality to operating system’s kernel.
computer components, manage the hardware and serve as interface between the computer
user and the computer. The operating system is called a virtual machine as ithides the When a running program needs a service from the operating system, it calls a system call.
complexity of the hardware and presents the user with an interface that is easier to
understand and program. 1.1.2. Memory Management
The operating system is stored on disk, but it needs to be loaded into memory (RAM) once For a program to be executed, it must be found in main memory (RAM). In a
the computer is switched on and before any other program can be run. The term multiprogramming environment in which several programs can reside in memory at the
bootstrapping refers to the process of loading the operating system into a computer’s same time, every program and its data must be protected from the actions of other
memory. This process is done by a program called the bootstrap loader that is stored programs. Memory management keeps track of what programs are in memory and where
permanently in the computer’s electronic ROM chip. Examples of operating systems are in memory they reside.
Windows (95, 98, 2000, XP, Vista, 7 and 8), Macintosh Operating System (Mac OS), Linux Memory allocation determines where a program as well as its related data will be kept in
and UNIX. memory for execution. Memory needs to be allocated efficiently to pack as many jobs in
memory as possible. Memory can be subdivided into segments or frames (pages).
1.1.1. Operating System Structure
The operating system can be divided into two main components: kernel and command a. Segmentation
interpreter (shell). Segmentation is when memory is divided into variable sized units called segments. When
segments are used, memory allocation can be done in three different ways:
o First fit allocates the first free segment that is large enough for the new process.
o Best fit allocates the smallest block among those that are large enough for the
new process.
o Worst fit allocates the largest block among those that are large enough for the
new process.
b. Paging
OS structure
©A LEVEL ICT/ Csc 21
Paging is when memory is divided into fixed-size units called frames. Jobs are broken up In other words, it is the length of time it takes to run a process from initialization to
into blocks of same size as frames called pages which are allocated a number of frames. The termination, including all the waiting time.
OS then uses a page table to map program pages to memory frames. The pages for each job
could be in logical order or they may be scattered about wherever there is a free frame. Assignment: Define the terms scheduler and dispatcher.
c. Starvation
Starvation is a situation where a task can never finish because it can never get a necessary b. Shortest Job First
resource such as a large block of memory. The operating system should detect such tasks Shortest job first (SJF) algorithm looks at all the processes in the ready state and dispatches
and do its best to allocate the resources that they need. the one with the smallest execution time. It is also generally implemented as a non-
preemptive algorithm. Using the SJF algorithm, we have
1.1.4. Process/CPU Scheduling
CPU scheduling is the act of determining which process in the ready state should be moved
to the running state. It decides which process in memory is to be executed by the CPU at
any given moment. Scheduling decisions may take place when a process:
1. Switches from running to waiting state
Disadvantage
2. Switches from running to ready state
Some jobs may never be executed as they have a high service time (starvation).
3. Switches from waiting to ready
4. Switches from running to terminated
c. Round Robin
Round-robin algorithm distributes time equitably among all ready processes by
Scheduling can be preemptive or non-preemptive.
establishing a particular time slice (or time quantum), during which each process executes.
At the end of the quantum, the process is preempted. It returns to the ready state to allow
Preemptive scheduling is scheduling in which the currently executing process is
another process its turn. Using round-robin algorithm with time slice of 50, the above
forced to give up the CPU. Scheduling under (2) and (3) is preemptive.
processes will be scheduled as follows:
There exist different algorithms used for scheduling. Examples are first come, first served,
shortest job first and round robin algorithms.
1.1.5. Management of I/O Devices
a. First Come, First Served
First come first served algorithm moves processes to the CPU in the order in which they a. Interrupts
arrive in the ready queue. It is non-preemptive. As such, when a process has the CPU it runs An interrupt is a signal generated by hardware or software that causes the CPU to suspend
to completion before giving up the CPU. what it is doing to handle another task of higher priority. Any event that will cause an
Consider that the following processes arrive in the order they are given below. interrupt is called an interrupt request (IR). For example, a key pressed on the keyboard.
An interrupt handler or interrupt service routine (ISR) is a program that services an
interrupt request. It contains the actions that will be executed for a given interrupt request.
Process Service time
P1 140 b. Polling
P2 75
c. Buffering
P3
A buffer is an area of memory used to temporarily store data while it is being moved from
P4 280 one place to another.
P5 125
1.1.6. File Management
The file system is the portion of the operating system that manages how files are stored.
Using FCFS algorithm to schedule the processes, we get
Examples of file systems are FAT used in MS DOS, NTFS used in Windows, ext2 used in
Definition: File format is a particular way that data is encoded for storage in a computer file.
V. FILE FORMAT AND ORGANISATION
A particular file format is often indicated as part of a file's name by a file name extension.
Introduction Conventionally, the extension is separated from the file name by a dot and contains three
Computers process and store all forms of data in binary format. or four letters that indicate the format. A file name is a unique name that is given to a file
within its file directory. For example, lectures.docx is a file with filename “lectures” and
1. Data Hierarchy extension “.docx” indicating that the file is an MS Word 2007 document.
Data items processed by computers form a data hierarchy in which they become larger and There are as many different file formats as there are different programs to process the files.
more complex in structure as we progress from bits, to characters, to fields and to larger A few of the more common file format types are:
data elements. Data elements can be organized in a hierarchical form as follows:
2.1. Graphics File Formats
Bit Byte (character) Field Record File Database Computers store graphic images as either bitmap images or vector graphics.
o MP3- MPEG Layer 3 Depending on the arrangement of records in a file, files can be serially, sequentially or
o WMA- Windows Media Audio randomly organized.
o WAV - Waveform audio file
o MIDI- 3.1. Serial File Organization
Serial files are files in which records are stored in chronological order with no particular
2.2.2. Video File Formats sequence. As each record is received it is stored in the next available storage space. In
order to access a particular record, the file must be read record by record from the
o AVI - Audio Video Interleave beginning of the file until the required record is found. This type of access is called serial
o MPEG or MPG - Motion Picture Experts Group access. Serial access is very slow which makes it impossible for serial files to be very useful
The value of any digit in a given n-digit number is obtained by multiplying the digit by its i. 101 × 10 = 1010 ……………………………….. (5 × 2 = 10)
place value. The value of the number is the sum of the products of the digits and their place ii. 111 × 101 = 100011 …………………………. (7 × 5 = 35)
values. That is, we multiply each digit by its place value, then we add the different products iii. 11011 × 1101 = 101011111 ……………… (27 × 13 = 351)
obtained.
Example: 234 = 2 × 10 + 3 × 10 + 4 × 10 . This means that there are two one 1.2.4. Binary Division
hundreds, three tens and four ones in the number 234. Rules for division:
0/1 = 0; 1/1 = 1; 1/0 = undefined.
Remark Each digit position in decimal has a weight that is ten times the one to its
immediate right. That is, 10 is ten times greater than 10 which is ten times greater 1.3. The Octal System
than 10 . The octal system has a base value of 8. It uses the digits 0-7 to represent any quantity.
Weights in octal are powers of eight as shown below.
1.2. The Binary System Least Significant
Most Significant
The binary system has a base value of 2. Only two digits 0 and 1, are used to represent any 8 … 8 8 8 Digit (LSD)
Digit (MSD)
quantity in binary. These digits are called binary digits or more commonly bits. To express
any quantity in binary we use powers much like in the decimal system but this time, the Octal positions
weights are powers of 2 as shown below.
Where 8 is the one’s place
Least Significant
Most Significant 8 is the eights place
Bit (LSB)
Bit (MSB) 2 … 2 2 2 8 is the sixty fours place
Exercise: Convert the following binary numbers to decimal Example 2: 34110 to base 2
iii) 1010.1012
iv) 10011.0012 512 256 128 64 32 16 8 4 2 1
512is greater 341 so we mark it out. What is left is
b. Binary to Decimal 256 128 64 32 16 8 4 2 1
There are two methods that can be used to convert decimal numbers to binary: 341 − 256 = 85 we place 1 under 256 (MSB)
- repeated division method 85 − 128 = we place 0 under 128
- repeated subtraction method 85 − 64 = 21 we place 1 under 64
21 − 32 = we place 0 under 32
Repeated Division Method 21 − 16 = 5 we place 1 under 16
The general technique of this method can be used to convert any decimal number to any 5−8 = we place 0 under 8
other number system. 5−4 = 1 we place 1 under 4
Step 1: divide the decimal number you want to convert by 2 in regular long division 1−2 = we place 0 under 2
until you obtain a final remainder 1−1 = 0 we place 1 under 1(LSB)
Step 2: use the remainder as the least significant bit of the binary number
Step 3: divide the quotient you got from the first division operation by 2 until you Therefore, 341 = 10101010101
obtain a final remainder
Step 4: use the remainder as the next digit of the binary number Example 3: Convert 25.75 to binary
Step 5: repeat steps 3 and 4 as many times as necessary until you get a quotient that
cannot be divided by 2. 25 = 11001 ,
Step 6: use the last remainder (that cannot be divided by 2) as the most significant bit 0.75 × 2 = 1.5 1
of the binary number. 0.5 × 2 = 1.0 1
0.75 = 11
Example 1: Convert 213 to base 2
213/2 = 106 remainder 1 LSB ⇒ 25.75 = 11001.11
106/2 = 53 remainder 0
53/2 = 26 remainder 1 Example 4: Convert: 33.33 to decimal.
26/2 = 13 remainder 0
13/2 = 6 remainder 1 1.5.2. Binary/Octal Conversion
6/2 = 3 remainder 0
3/2 = 1 remainder 1
1/2 = 0 remainder 1 MSB
001 1
The following is the binary-hexadecimal conversion table
010 2
Binary Hexadecimal Binary Hexadecimal
011 3
0000 0 1000 8
100 4
0001 1 1001 9
101 5
0010 2 1010 A
110 6
0011 3 1011 B
111 7
0100 4 1100 C
a. Binary to Octal
0101 5 1101 D
Step1: make groups of three bits starting from the least significant bit and move towards
the most significant bit. 0110 6 1110 E
Step 2: replace each group of bits by its octal representation. 0111 7 1111 F
2) Convert the following hexadecimal numbers to octal. The drawbacks of sign-magnitude representation are:
i) 12B16 o There are two representations (0000 0000 and 1000 0000) for the number zero,
ii) F2E16 which could lead to inefficiency and confusion.
o Arithmetic is cumbersome making the design of electronic circuits for this scheme
2. Data Representation difficult.
Computers use binary patterns (fixed number of bits) to represent data, which could be
numbers, letters, videos, images or other symbols. It is important to decide on how these 2.2.2. 1’s Complement Representation
patterns will be interpreted. The interpretation of binary patterns is called data In 1's complement representation the most significant bit is still the sign bit. The remaining
representation or encoding. Different representation schemes exist. ( − 1) bits represent the magnitude of the integer as follows:
o for positive integers, the absolute value of the integer is equal to "the magnitude
2.1. Representation of Unsigned Integers of the ( − 1)-bit pattern".
Unsigned integers can represent zero and all positive integers. The value of an unsigned o for negative integers, the absolute value of the integer is equal to "the magnitude
integer is interpreted as “the magnitude of its underlying binary pattern”. That is, for an of the complement (inverse) of the ( − 1)-bit pattern".
unsigned integer, all the bits in the binary pattern are used to represent the magnitude of
the integer. Example 1: Using 1’s complement, represent the following base 10 numbers on 8 bits.
In binary, an n-bit pattern can represent 2 distinct integers. Therefore, an n-bit pattern i) 26 = 11010
will represent integers from 0 to 2 − 1. Number is positive ⇒ sign bit is 0
⇒26 = 0 0011010
For example:
o A 4-bit pattern will represent the integers 0 to (2 ) − 1 = 3 ii) −25
o An 8-bit pattern will represent the integers 0 to (2 ) − 1 = 255 Number is negative ⇒ sign bit is 1
25 = 11001
2.2. Representation of Signed Integers Complement of 0011001 is 1100110
Signed integers can represent zero, positive integers, as well as negative integers. Four ⇒−25 = 1 1100110
representation schemes are available for signed integers:
1. Sign-Magnitude representation Example 2: Give the decimal equivalent of the following 1’s complement binary
2. 1's Complement representation representations.
Step 4: The mantissa stored is what is on the right side of the radix point of the normal
o In 64-bit single-precision floating-point representation: form.
the most significant bit is the sign bit (S), with 0 for negative numbers and 1 for So M is 0000000110011001100110
positive numbers.
Putting all these together we have 64.2 represented as:
the following 16 bits represent the exponent (E).
the remaining 47 bits represent the mantissa (M) or fraction (F).
0 10101 00000001[10011001100110]
NB: On 8 bits we see that part of the number will be missing. That is why we say the
In floating-point representation, the mantissa and exponent play two important roles. The
mantissa determines the precision (exactness) of the number.
mantissa affects the precision of the number while the exponent affects the range. Precision
has to do with the exactness of a number while range has to do with the set of numbers that
b. −15.375
can be represented.
Negative number ⇒ sign bit is 1
15 = 1111
For simplicity, we will use a 14-bit pattern for floating point with a 5-bit exponent and an
0.375 × 2 = 0.75 0
8-bit mantissa. In this case, we will use excess-16 representation for the exponent.
0.75 × 2 = 1.5 1
Examples:
0.5 × 2 = 0.96 0
0.5 × 2 = 1.0 1
c. 0.125
Positive number ⇒Sign bit is 0
0 = 0000
0.125 × 2 = 0.25 0
0.25 × 2 = 0.5 0
0.5 × 2 = 1.0 1 VII. DIGITAL ELECTRONICS
a. AND Gate
Logic NAND
It is a logic gate whose output is “true” only when both inputs are “true”. If neither or only
one of the inputs is “false”, the output is “false”. The following illustration and table show
the circuit symbol and logic combinations for an AND gate.
A B Output
e. NOR Gate 0 0 1
A B Output
A NOR gate is equivalent to an 0 1 0 OR gate followed by a NOT
0 0 1
Logic AND gate. Its output is "true" if both inputs are "false."
1 0 0
0 1 1 Otherwise, the output is "false."
1 1 0
1 0 1
1 1 0
A B Output
b. OR Gate 0 0 0
It is a logic gate whose output is “true” when either or both of the inputs are “true”. If both Logic NOR 0 1 0
inputs are "false," then the output is "false."
1 0 0
1 1 1
A B Output
f. XOR Gate
0 0 0 Exclusive-OR is a logic gate whose output is “true” when one but not both of its inputs is
Logic OR 0 1 1 “true”. The output is "false" if both inputs are "false" or if both inputs are "true." Another
way of looking at this circuit is to observe that the output is “true” if the inputs are
1 0 1
different, but “false” if the inputs are the same.
1 1 1
A B Output
c. NOT Gate
It is a logic gate whose output is “false” if its input is “true” and vice versa. It is called logical 0 0 0
inverter, because it reverses the state of its input. A NOT gate accepts one input and Logic XOR 0 1 1
produces a single output. 1 0 1
1 1 0
©A LEVEL /ICT&Csc 37
2.2. Logic Circuits 1. Data and Information
Circuits are made by combining two or more logic gates. Gates are combined into circuits Data are raw facts and figures that have no context or purposeful meaning. In computing,
by using the output of one gate as the input for another. data is simply any number, letter or symbol that can be entered into a computer system.
Examples When data has been processed it gives information. Information is data that has meaning
and is presented in a context.
For example, the number 12.5 is data because we do not know why or in what context it is
being used. However, if the number appears on a student’s report card to show that they
have an average of 12.5, then this data has changed into information, because it has
acquired a context (it’s an average) and meaning.
Also, the binary patterns that describe an icon on your desktop are data. They become
information after the operating system software has processed them, because then they
become meaningful to you as the icons representative of your hard disk or Internet
explorer.
In summary,
= +
Exercise 1: Construct logic circuits for the following expressions 1.1. Sources of Data
1) + a. Questionnaire
A questionnaire is a set of questions used for collecting data from people. A questionnaire
2) ( + )( + )
may be in paper format or online.
3) ( + )
4) ( + )(ABC)
b. Interview
5) ( + )
An interview is a meeting during which somebody is asked questions. Interviews allow you
to collect a greater depth of data and understanding from people than is possible by just
Exercise 2: What are the outputs for the following logic circuits
using a questionnaire.
c. Observation
In observation, the data gatherer observes what is happening during a process or event and
produces some kind of data file as a result
d. Data logging
Data logging is an automated method of gathering data by using sensors.
e. Document review
Document review is getting relevant data from a document, an article or a book.
VIII. INFORMATION SYSTEMS
f. Data mining
Introduction
Data mining is the exploration of databases to collect data.
A system is an integrated set of regularly interacting or interdependent components
created to accomplish a defined objective, with defined and maintained relationships
1.2. Characteristicsof Information
among its components. Basically, there are three major units in every system namely input,
Good information is that which is used and which creates value. Experience and research
processing and output. The objective of a system demands that some output be produced
show that good information has numerous qualities.
as a result of processing the suitable inputs.
An information system can therefore be seen as a set of interrelated components that
a. Timeliness
collectdata, process the data to produce information.
©A LEVEL ICT 38
Delay destroys the value of information. For effective decision making, information must
reach the decision-maker at the right time. Timeliness means that information must reach b. Data Validation
its recipients within the prescribed timeframes. Validation is a check on input data to ensure that the data is sensible or reasonable. It
compares the input with a set of rules that the computer has been told the data must
b. Accuracy follow. If the data does not match up with the rules then there must be an error. Validation
Wrong information given to decision-makers would result in wrong decisions. Accuracy only checks that the data is valid. The data may be valid but not correct. Five types of
means that information should be free from mistakes and errors. validation checks are:
©A LEVEL ICT 39
the keyboard. This method is suitable for capturing data from airline tickets; reading postal
o Divide the total by 11 and then subtract the remainder from 11. The check digit is codes; capturing data from telephone and electric bills.
the result of this operation.
228 / 11 = 20 remainder 8 => Check digit is 11-8 = 3. c. Magnetic Ink Character Recognition (MICR)
o Add the check digit to the end of the original number to get the complete product The device used is a magnetic ink character reader that reads characters written in
number. i.e. 1858134153. magnetic ink, using magnetic stripe readers or card swipe machines that capture the
information on the magnetic card. These are seen on the back of credit cards and bank
To check whether the ISBN is correct, cards.
o Input the number including the check digit.
o Weight each digit by its position in the string and add up the results. d. Barcode Reading
An optical device called barcode reader is used to read the barcode on products and
Position 10 9 8 7 6 5 4 3 2 1 convert them into a form that can be processed by the computer. A bar code is a sequence
of vertical lines and numbers that identify a product. They are used in libraries,
Digit 1 8 5 8 1 3 4 1 5 3
supermarkets and retail shops.
Weightings 10 72 40 56 6 15 16 3 10 3
e. Voice Recognition
Total = 10+72+40+56+6+15+16+3+10+3 = 231 This method converts speech into text or a sequence of computer commands. It is most
common for data entry and word processing environments.
o Divide the total by 11.If the remainder is 0, then the number has passed the
validation check and so it is likely that it has been inputted correctly. 2. Information System Components
231 / 11 = 21 remainder 0 There are six basic components in an information system: hardware, software, procedures,
data and people.
Exercise:
i) Dates are read into a computer in the following format: DDMMMYY e.g. 15DEC92. Hardware
The following dates were rejected by a validation program: 3JAN71, AUG2166, Hardware refers to the physical devices that make up the system. They are the whole set of
31SEP72. State the validation check used to discover each error. equipment used for input, processing, storage and communication of data.
ii) Calculate the check digitsto complete the ISBNs:019276150-1 and 995640216-8. Software
Software is the collection of computer programs used in the system. They provide the
iii) Set up a spreadsheet which will calculate and check the validity of Modulo-11 instructions that tell the computer what to do.
weighted check digits for any given ISBN.
Data
1.3.2. Automatic Data Collection Data are raw, unorganized, potentially useful facts and figures that are processed to
Automatic data collection is a form of data input in which there is no data entry. It uses produce information.
sensors and specialized input devices to collect data that is directly entered into the
computer without any human involvement. It is also called data capture. Different People
automatic data collection methods are: People are the main actors of the system. They are the users of the information system.
They input data into the computer, give some direction to the computer to perform tasks
a. Optical Mark Recognition (OMR) and review information on the computer for output.
OMR uses a device called an optical mark reader to read marks made with prescribed pens,
pencils or special writing material on OMR forms, and convert them into information in the Procedures
computer. This system is good for multiple choice examination questions. Procedures are the series of documented actions taken to achieve a particular goal. A
procedure is more than a single simple task. It can be complex and involved, such as
b. Optical Character Recognition (OCR) reinstalling software, performing a backup etc.
This method uses a device called an optical character reader to read characters from
printed or handwritten text and transmit them to the computer as if they were typed from
©A LEVEL ICT 40
3. Organizational Information Systems With batch processing, transaction data is collected over a period of time and all processing
There are three levels at which information can be used in an organisation: strategic, is done as a group. Batch processing is ideal in situations where large amounts of data
tactical and operational levels. This can be represented using the pyramid below. requiring similar processing are to be processed. Examples are:
Payrollsystems for calculating employee salaries
Billing systems for calculating consumer bills.
©A LEVEL ICT 41
totals, tables, or graphs. An inventory summary report is an example of a summary 4. Other Information Systems
report. 4.1. Expert Systems
An expert system is a computer program that tries to emulate the decision making of a
Exception reports report information that is outside of a normal condition. These human expert. It does this by combining the knowledge of human experts and then,
conditions called the exception criteria, define the range of what is considered following a set of rules, it draws inferences. An expert system is made up of three parts: a
normal activity or status. An example of an exception report is an inventory knowledge base, an inference engine and a user interface.
exception report that notifies the purchasing department of items it needs to reorder. The knowledge base stores all of the facts, rules and information needed to represent
Exception reports help managers save time because they do not have to search the knowledge of the expert.
through a detailed report for exceptions. Instead, an exception report brings The inference engine is the part of the system that interprets the rules and facts using
exceptions to the manager’s attention in an easily identifiable form. Exception backward and forward chaining to find solutions to user queries.
reports thus help them focus on situations that require immediate decisions or The user interface allows the user to enter new knowledge and query the system.
actions.
Non-management employees are the primary users of such systems for job-related
Examples of MIS are: decisions. For example, there are expert systems that can diagnose human illnesses, make
Sales management systems financial forecasts, and schedule routes for delivery vehicles.
Inventory control systems
Budgeting systems Expert systems are one part of an exciting branch of computer science called artificial
Management reporting systems intelligence (AI). AI is the application of human intelligence to computers. AI technology
can sense your actions and, based on logical assumptions and prior experience, will take
3.2.2. Decision Support Systems the appropriate action to complete the task. AI has a variety of capabilities, including
Decision support systems are designed to help tactical and strategic decision-making in speech recognition, logical reasoning, and creative responses.
situations where there is uncertainty about the possible outcomes of those decisions. They
provide interactive support for non-routine decisions or problems. 4.2. Geographic Information System
TPS and MIS provide information on a regular basis. However, managers need information
not provided in their reports to help them make decisions. Decision support systems
therefore use data from internal (TPS and MIS) and external sources. IX. DATA COMMUNICATION SYSTEMS
o Internal sources of data might include sales, manufacturing, inventory, or
financial data from an organization’s database. Introduction
o Data from external sources could include interest rates, population trends, and The use of computers and data communications networks has been termed the ‘second
costs of new housing construction or raw material pricing. industrial revolution’, because it is revolutionizing the way people work and communicate.
Examples of DSS are:
Logistics Systems 1. Computer Networks
Financial Planning Systems A computer network is a collection of computers and other devices that are connected
Spreadsheet Models together so they can communicate and share resources. The smallest network can be as
simple as two computers linked together. The resources shared include files, folders,
3.2.3. Executive Information Systems printers, disk drives and anything else that exists on a computer. Any computer or device
Executive information systems (EIS) are designed to support the information needs of on a network is called a node.
executive management. Their purpose is to analyse, compare and identify trends to help Networking is the term that describes the processes involved in designing, implementing,
the strategic direction of the organisation. Information in an EIS is presented in charts and upgrading, managing and otherwise working with networks and network technologies
tables that show trends, ratios, and other managerial statistics. Because executives usually
focus on strategic issues, EISs rely on external data sources that can provide current 1.1. Types of Computer Networks
information on interest rates, commodity prices, and other leading economic indicators. Different criteria exist for classifying computer networks. According to geographical area
To store all the necessary decision-making data, DSSs or EISs often use extremely large covered, networks can be classified as local area networks, wide area networks,
databases, called data warehouses. metropolitan area networks, personal area networks etc.
©A LEVEL ICT 42
1.1.1. Local Area Network 1.2.2. Network Interface/Adapter Card
A local area network (LAN) is a network that is used for communication among computer A network interface card (NIC) provides the physical interface (link) between the computer
devices, usually within an office building or home. It enables the sharing of resources such and the communication medium. A NIC manages the communication and network protocol
as files or hardware devices that may be needed by multiple users in an organization. A for the PC.It prepares data, sends data and controls the flow of data. It plugs into the system
LAN is limited in size, spanning a few hundred meters, and not more than a mile. It is fast, board and provides ports for connection to the network. A NIC is also called a LAN card or
with speeds from 10 Mbps to 10 Gbps. An example of LAN is the network in the Multimedia network adapter card. There are two kinds of NIC: wired NIC for wired networks and
Resource Centre. wireless NIC (WNIC) for wireless networks. A NIC may be designed as an Ethernet card, a
Token Ring card, or an FDDI card (but not all three).
1.1.2. Metropolitan Area Network
A metropolitan area network (MAN) is a large computer network that usually spans a city 1.2.3. Hub
or a large campus. It is optimized for a larger geographical area than a LAN, ranging from A hub is a device that works as central connecting point for multiple computers in a
several blocks of buildings to entire cities. A MAN typically covers an area of between 5 and network. It has ports to which the computers in the network are connected. Data sent to
50 km diameter. An example of a MAN is a cable TV network. the hub is broadcasted to all the ports but, only the destination computer receives it. There
are three kinds of hubs:
1.1.3. Wide Area Network Passive hubs which only split the transmission signal so it can be sent to all the ports
A wide area network (WAN) covers a large geographic area such as a country, a continent Active hubs (also called Multiport Repeaters) which regenerate data bits to maintain
or even the whole world. It is a distributed collection of LANs. That is, it connects two or a strong signal over extended cable lengths
more LANs together. This is done using devices such as bridges, routers or gateways, which Intelligent hubs (also called Concentrators) usually have their own microprocessor
enable them to share data. The largest and most well-known example of a WAN is the chips and network operating systems. They can be managed remotely on the
Internet. network.
©A LEVEL ICT 43
the protocol needed by the destination network. The term gatewayis also sometimes
1.2.7. Router loosely used to describe any device that acts as the entry or exit point for a network.
A router is a device that joins several networks together and is responsible for routing data
from one network to another. It keeps track of the IP addresses of the computers on the 1.3. Network Topologies
networks connected to its network interface cards and directs data packets appropriately. Network topology is the layout or arrangement of the components of a network. It refers to
It is more powerful than a bridge because instead of just choosing network segments based the way in which computers and cables are connected together to build a network.
on previous traffic, a router can look up the best route for a packet to take. Routers can be Different types of topologies exist.
computers with operating systems and special network software, or they can be other
dedicated devices built by network manufacturers. The Internet relies heavily on routers. 1.3.1. BusTopology
In bus topology, all computers are connected to a single cable (trunk or backbone) known
1.2.8. Modem as bus, by a transceiver either directly or by using a short drop cable. Bus transmits in both
A modem (modulator/demodulator) is a device that encodes data for transmission over a directions such that any transmission can be received by all stations. All ends of the cable
particular medium, such as telephone line, coaxial cable, fiber optics, or microwaves. It must be terminated, that is plugged into a device such as a computer or terminator, to
converts digital signals from a computer to analog signals or waveform for transmission avoid signals from bouncing back.
over a medium (modulation) and converts analog signals from the medium to digital
signals understandable by the computer(demodulation).
Common types of modems are:
Dial-up Modem
Cable Modem
DSL Modem Bus topology
Sat modem a. Advantages
Easy and inexpensive to set up as little cabling is required
1.2.9. Multiplexer Easy to include additional stations without disrupting the network
A multiplexer abbreviated MUX, is a device that takes input signals from different sources Failure of one node does not affect network
and transmits them over a single transmission line. This process is known as multiplexing.
There are different types of multiplexing: b. Disadvantages
Frequency-division multiplexing (FDM), in which the carrier bandwidth is divided High rate of data collision
into sub channels of different frequency widths, each carrying a signal at the same Fails if there is any damage to the bus
time in parallel. Any break in the bus is difficult to identify
Time-division multiplexing (TDM), in which the multiple signals are carried over the
same channel in alternating time slots. 1.3.2. StarTopology
Code-division multiplexing (CDM), in which the multiple signals are carried over the In a star topology, all the computers are connected to a central device which could be a
same channel but every signal is coded differently. computer, a hub or a switch. Any communications between computers in this topology
must pass through the central node. As such, the central node controls all the activities of
Orange and MTN use a combination of FDM and TDM called GSM while Camtel uses CDMA. the network.
1.2.10. Cables
Cables are used to link computers in a LAN. There are three types of cables commonly used:
Coaxial cable
Twisted pair cable
Fiber optic cable
Star topology
1.2.11. Gateway
A gateway is a device that connects two dissimilar computer networks using direct and a. Advantages
systematic translation between protocols. A gateway translates outgoing network traffic to Breakdown of a node does not affect the network
No disruption of the network when connecting or removing devices
©A LEVEL ICT 44
It is easy to detect faults to another and each computer can transmit only while it is holding the token. Information
flows in one direction along the ring from source to destination and back to source. When a
b. Disadvantage station wishes to transmit, it waits for the empty token to pass by. It seizes it and inserts
Failure of the central node affects the entire network data into it and then releases it to the medium. The token circulates until it gets to the
It is costly due to the amount of cables required to connect the devices destination computer that picks it and retrieves the data. After retrieving the data, it
regenerates the token and sends it back to the medium.
1.3.3. RingTopology
In ring topology, all the nodes are connected in the form of a closed loop such that each 1.4.3. FiberDistributed Data Interface
node is connected to two others. It uses an empty data packet called a token and a special FDDI is a network technology that uses fiber-optic cables in a ring topology with dual rings
protocol called token ring. Packets travel around the ring in a clockwise direction. To on which information can travel in opposite directions. The media access method for FDDI
transmit, a node requires an empty token. is token passing. The primary ring is used for data transmission, and the secondary ring
remains idle. Because of this double ring topology, if a station fails or a cable becomes
damaged, the dual ring is automatically wrapped around itself, forming a single ring. This
prevents downtime as a result of a failed machine or faulty wiring.
©A LEVEL ICT 45
providers are now just entering the market, offering customers an alternative to a DSL If the file server breaks down the files on the server become inaccessible. Email
Internet connection. might still work if it is on a separate server. The computers can still be used but are
isolated.
1.5. Network Architectures Viruses can easily spread to other computers throughout the network, if one
1.5.1. Client/Server Architecture computer is infected..
Client/server is a network architecture in which a more powerful computer called server is There is a danger of hacking, particularly with wide area networks. Security
dedicated to serving less powerful computers called clients. Servers hold shared resources procedures are needed to prevent such abuse, eg a firewall.
like files, programs and the network operating system. They provide access to network
resources to all the users of the network. There are many different kinds of servers, and 2. Data Communication
one server can provide several functions. For example, there are file servers, print servers, Data communication refers to the exchange of data between two devices via some form of
mail servers, database servers and Web servers. Users run applications on client communication channel. In data communication the following basic terms are frequently
workstations which rely on servers for resources such as files, devices and even processing used:
power. Data: a collection of facts in raw form that becomes information after processing.
Internet services are organized according to a client/server architecture. Client programs, Signal: an electric or electromagnetic encoding of data.
such as Web browsers and file transfer programs create connections to servers, such as Signaling: propagation of signals across a communication channel.
Web and FTP servers. The clients make requests and the server responds to the requests Transmission: sending of data from one place to another by means of signals.
by providing the services requested by the client.
There are five basic components in a communication system.
1.5.2. Peer-to-Peer Architecture Data Source: creates data for transmission
Peer-to-peer (P2P) is a network configuration in which all the workstations (computers) Transmitter: encodes data for transmission
have equal capabilities and responsibilities. Each workstation acts both as a server and a Communication channel: connecting medium between communicating devices
client. This means that any computer on the network can provide services to any other Receiver: decodes transmitted signals back to data
computer. Peer-2-peer is usually implemented where strict security is not necessary. Destination: the final destination of the transmission
P2Pnetworks are generally simpler and less expensive, but they usually do not offer the
same performance under heavy loads. Example: John calls Peter on phone.
The data source is John, the transmitter is John’s phone, the communication channel is the
Remark A hybrid network combines client/server and peer-to-peer architectures. It is telephone cable or microwave, the receiver is Peter’s phone and the destination is Peter.
the most commonly used network architecture.
2.1. Analog and Digital Signals
1.6. Benefits and Limitations Of Computer Networks Data is transmitted from one point to another by means of electrical signals that may be in
1.6.1. Benefits analogue or digital form.
Sharing devices such as printers saves money.
Site (software) licenses are likely to be cheaper than buying several standalone 2.1.1. Analogue Signals
licenses. An analog signal is one in which information is represented as a continuous variation of
Files can easily be shared between users. some physical property or quantity. Analog signals are continuous waves that carry
Network users can communicate by email and instant messaging. information by varying the frequency or amplitude of the wave.
Data is easy to backup as all the data is stored on the file server. When the amplitude of the signal is varied the technique is called amplitude
Organizations can organize videoconferences ( videoconferencing) modulation (AM)
Employees can work from home (telecommuting) When the frequency of the signals is varied, the technique is called frequency
modulation (FM).
1.6.2. Limitations Human speech is an example of an analog signal. Telephone lines use analog signals
Purchasing the network cabling and file servers can be expensive. because they were originally designed for speech.
Managing a large network is complicated.It requires training and a network
manager usually needs to be employed.
©A LEVEL ICT 46
2.3.2. Half Duplex
In half duplex mode, signals can be transmitted in both directions but only one way at a
time. The flow of information is bidirectional but information can only be sent if it is not
2.1.2. DigitalSignals being received. It is suitable for data transmission between a computer and dumb
A digital signal is one in which information is represented as a sequence of binary values 0 terminals. An example is the police radio (walkie-talkie).
and 1.These two values represent two conditions, on or off, corresponding to two known
levels of voltage or current.
A B
Digital signals do not continuously vary as analogue signals. Signals are transmitted within
the computer as digital signals. Systems that use digital technology are known as baseband
systems. 2.3.3. FullDuplex
In full duplex mode, signals can be transmitted in both directions simultaneously. The
communicating devices can transmit at the same time. The flow of information is
bidirectional. It is suitable for interactive systems. An example is the telephone.
A B
Coaxial cable
2.4.1. PacketSwitching
Packet switching is a switching method in which the message to be transmitted is broken To connect coaxial cable to devices, we need coaxial connectors. The most common type of
into small data packets and sent over the network. Each packet contains a portion of data connectors used today is the Bayone-Neill-Concelman, or BNC connector.
and some control information. The packets may take different routes to arrive their
destination and they may arrive in any other. On arrival, they are put back into order and b. Twisted Pair Cable
the message is reconstituted. Each packet is sent with a header address which tells what its Twisted-pair cable is the most common type of cabling used in LAN networks today. It
destination is. The header address also describes the sequence for reassembly at the consists of a pair or pairs of insulated wires twisted together. Cable twisting helps reduce
destination. One packet contains information on how many packets should be arriving. If a noise pickup from outside sources and crosstalk on multi-pair cables. There are two types
packet fails to arrive, the destination computer sends a message to the sender’s computer of twisted pair cables: shielded twisted pairs (STP) and unshielded twisted pairs (UTP).
asking it to send the missing packet again. This method is suitable for transmission of data.
Twisted pair cable uses RJ-14
2.4.2. Circuit Switching and RJ-45 connectors
Circuit switching is a switching method in which a dedicated communication path in
physical form between two stations within a network is established, maintained and
terminated for each communication session. This channel remains open throughout the Twisted pair cable
communication process and cannot be used by anyone else. It has basically three phases:
circuit establishment, data transfer and circuit disconnect. The message is sent without Unshielded Twisted Pair
being broken up, so it is received in the order it was sent. This method was designed for UTP cables consist of 2 or 4 pairs of twisted cable. Cable with 2 pair use RJ-11 connector
voice transmissions. Telephone networks use circuit switching for transmission of phone and 4 pair cable use RJ-45 connector. RJ stands for registered jack. There are five levels of
calls. UTP:
2.5. Transmission Media Category 1: These are used in telephone lines and low speed data cable.
A transmission medium is the physical pathway that connects computers and other devices Category 2: These cables can support up to 4 mps implementation.
on a network. Each transmission medium requires specialized network hardware that is Category 3: These cable supports up to 16 mps and are mostly used in 10 mps.
compatible with that medium, and most networks need to use a combination of Category 4: These are used for large distance and high speed. It can support 20mps.
transmission media types selected based on the network's needs.There are two categories Category 5: This is the highest rating for UTP cable and can support up to 100mps.
of transmission media: guided and unguided media.
UTP can be connected as straight through or crossover. A straight-thru cable has identical
2.5.1. Guided Media ends. A crossover cable has different ends.
Guided media are the physical links through which signals are confined to narrow path.
They are made up of an internal conductor bounded by jacket material. They are also called c. Fiber Optic Cable
bounded or conducted media. Three common types of guided media are coaxial cable, Fiber optic cables use optical fibers that carry digital data signals in the form of modulated
twisted pair cable and fiber optical cable. light pulses. An optic fiber consists of an extremely thin cylinder of glass, called the core,
surrounded by a concentric layer of glass, known as the cladding. Each cable has two fibers
a. Coaxial Cable - one to transmit and one to receive.
©A LEVEL ICT 48
There are two types of optic fibers: traveling in a straight line, the earth’s curvature poses a problem to long distance
A single mode fiber (SMF) uses a single ray of light to carry transmissions over long microwave transmissions. As such,long distance transmissionsrequiredirectional antennas
distances. (repeaters)to be used at intervals of 25 to 30 kilometers between the transmitting and
A multi-mode fiber (MMF) uses multiple rays of light simultaneously with each ray receiving end.
of light running at a different reflection angle to carry transmissions over short
distances. Satellite systems use communication satellites to solve the problem posed by the
earth’s curvature to terrestrial microwave systems. A communication satellite is a
microwave relay station placed in outer space. A microwave signal is transmitted from
earth to the satellite which amplifies the signal and sends it back to earth. The earth station
transmits the signal to the satellite on an up-link, on one frequency and the satellite repeats
those signals on a down link which is on another frequency.
Optic fiber
The light source can be LED (light emitting diode) or LD (laser diode)
2.5.2. UnguidedMedia
Unguided media do not use physical means to define the path to be taken. They provide a
means for transmitting electromagnetic waves but do not guide them. They are also called
unbounded media. Examples of unguided media are infrared waves, radio wavesand
microwaves. Advantages of microwave systems
o No cables needed
a. Infrared o Multiple channels available
Infrared uses transmitters/receivers (transceivers) that modulate non-coherent infrared o Wide bandwidth
light. Infrared signals do not penetrate walls as such transceivers must be within line-of-
sight either directly or via reflection. Line of sight is a type of propagation that can transmit Disadvantages
and receive data only where transmit and receive stations are in view of each other without o Line-of-sight will be disrupted if any obstacle, such as new buildings, are in the
any sort of an obstacle between them. way
o Signal absorption by the atmosphere. Microwaves suffer from attenuation due to
b. Radio waves atmospheric conditions.
Radio wave systems transmit signals by modulation of electromagnetic waves with o Towers are expensive to build
frequencies below that of visible light. Radio waves carry information by systematically
changing some property of the radiated waves such as amplitude (AM radio), frequency 2.6. Transmission Checks
(FM radio) and phase. Radiowaves are omnidirectional.This means that signals spread out Network data transmissions often produce errors, such as toggled, missing or duplicated
in all directions and can be received by many antennas. bits. As a result, the data received might not be identical to the data transmitted, which is
obviously a bad thing. Because of these transmission errors, network protocols very often
c. Microwaves use error-detection codes. Examples of error-detection codes include parity checking,
Microwaves are electromagnetic radiations beyond the frequency range of radio and checksums and cyclic redundancy checks.
television. There are two types of microwave systems: terrestrial microwave systems and
satellite systems. 2.6.1. ParityChecking
Terrestrial microwavesystemsare land-based. Microwaves being line-of-sight and Parity checking refers to the process of using a parity bit to check that data has been
transmitted accurately. A parity bit is an extra bit transmitted with a data unit that will be
used to check its integrity. There are two types of parity: odd parity and even parity.
©A LEVEL ICT 49
In odd parity, the parity bit is added such that the total number of bits at 1, in the data 2.7.2. Interrupt
unit, is an odd number. An interrupt is a signal to the processor emitted by hardware or software indicating an
In even parity, the parity bit is added so that the total number of 1s is an even event that needs immediate attention. An interrupt alerts the processor of a high-priority
number. condition requiring the interruption of the current task the processor is executing.
Example: What are the parity bits for the following data units in odd parity? Interrupts are used to handle such events as data receipt from a modem or network, or a
key press or mouse movement.
i) 111011011 ii) 001001010 iii) 110101010
2.7.3. Polling
Example 2: What are the parity bits for the following data units in even parity? Polling is the process by which the central computer or communications controller in a
network, "polls" or asks each device in the network if it has a message to send and then
i) 011010100 ii) 111001011 iii) 100111000 allows each in turn to transmit data. Access and control of star network typically is
maintained by a polling system.
2.6.2. Checksum
2.7.4. Handshaking
A checksum or hash sum is a count of the number of bits in a transmission unit that is
Handshaking is the process by which two devices initiate communications. It begins when
included with the unit for the purpose of detecting errors that may have been introduced
one device sends a message to another device indicating that it wants to establish a
during transmission. The checksum or hash sum may be computed according to the
communications channel. The two devices then send several messages back and forth that
number of set or unset bits in the message. On reception, the receiver applies the same
enable them to agree on a communications protocol.
checksum function/algorithm to the message. If the checksum obtained matches the one
sent, the transmission is considered to be successful and error-free.
2.8. Communication Protocols
For proper communication in a network, different entities must speak the same language.
2.6.3. CyclicRedundancy Check
There must be mutually acceptable conventions and rules about the content, timing and
A CRC is an error-detection code in which each segment of the original message is
underlying mechanisms. These conventions and associated rules are referred as protocols.
combined with additional bits to make a binary number that is divisible by some previously
chosen divisor.
Definition: A protocol is a set of rules and conventions that govern how devices on a network
kis the length of the message we want to send, i.e., the number of information bits.
communicate.
nis the total length of the message we will end up sending the information bits
followed by the check bits. Peterson and Brown call this a code polynomial.
The need for a protocol is obvious: it allows different computers from different vendors
n-kis the number of check bits. It is also the degree of the generating polynomial. The
and with different operating characteristics to ‘speak the same language’. The same
basic (mathematical) idea is that we're going to pick the n-k check digits in such a
protocols must be followed by each machine involved in the communication in order for
way that the code polynomial is divisible by the generating polynomial. Then we send
the receiving host to be able to understand the message. A protocol may be physical or
the data, and at the other end we look to see whether it's still divisible by the
logical.
generating polynomial; if it's not then we know we have an error, if it is, we hope
there was no error.
2.8.1. Physical Protocols
Physical protocols are concerned with how a device connects to a medium. They ensure
2.7. Peripheral Device Control
that a device connected to a medium can transmit through the medium. They make sure
2.7.1. Buffering
that the layout of pins on the connectors is the same and that devices are correctly
A buffer is an area of memory used to temporarily store data while it is being moved from
connected and configured. Few examples of physical protocols are 802.11 for Wi-Fi
one place to another. Buffers are used to compensate for differences in rate of flow of data
connections and DSL for broadband.
or time of occurrence of events, when transferring data from one device to another.
Routers use buffers to route data packets on the Internet. When a packet is sent from one
2.8.2. LogicalProtocols
router to
Logical protocols are concerned with data handling. They ensure that data are in the right
another via one or more intermediate routers, the packet is received at each intermediate
format for the application, the bit rates match at both ends, and the same error correction
router in its entirety, stored there until the required output line is free, then the packet is
is used. Examples of logical protocols are TCP/IP, HTTP, POP3, FTP, SMTP and WAP.
forwarded.
©A LEVEL ICT 50
2.8.3. The OSI Reference Model It is responsible for path determination, routing, and the delivery of packets across
The Open Systems Interconnection (OSI) reference model or more commonly the OSI internetworks. It is also responsible for addressing (also known as logical addressing) for
model is an ISO standard that defines how network communications take place by example IP addressing. Examples of protocols at this layer are: IP, IPX and ICMP.
providing a framework for standardization. The OSI model divides network Examples of devices that operate at this level are Layer-3 switches and routers. WAPs
communications into seven layers. Each layer is responsible for carrying out specific (wireless access points) with built-in routing capabilities also act at this layer.
functions when transmitting data on the network. The table below shows the layered
architecture of the OSI reference model. Layer 2: Data Link
It is responsible for reassembling bits taken off the wire by the physical layer to frames and
7 Application Layer makes sure they are in the correct order and requests retransmission of frames in case an
error occurs. It provides error checking by adding CRC to the frame. Examples of protocols
6 Presentation Layer
at this layer are: Etherne
5 Session Layer t, Token Ring, PPP and ISDN.
Examples of devices that operate at this layer are: switches, bridges, NICs and WAPs
4 Transport Layer (Wireless Access Points).
3 Network Layer
Layer 1: Ph
2 Data Link Layer These layers can be recalled using the ysical
following mnemonics: All People Seem This layer communicates directly with the communication medium. It is responsible for
1 Physical Layer activating, maintaining and deactivating the physical link. It defines electrical and optical
To Need Data Processing. (Layers 7 - 1)
signaling, voltage levels, data transmission rates, as well as mechanical specifications such
OSI Reference Model
as cable lengths, and connectors, the amount of pins and their functions. Examples of
devices that operate at this layer are: hubs, repeaters, and NICs.
Layer 7: Application
It provides network services directly to the user’s applications such as a web browser or e- These layers can be recalled using the following mnemonics: All People Seem To Need Data
mail client. This layer is said to be “closest to the user”. Examples of protocols that operate Processing. (Layers 7 - 1)
at this layer are: TELNET, HTTP, FTP, SMTP and POP.
3. The Internet
Layer 6: Presentation 3.1. Brief History
The Presentation layer represents the data in a particular format to the Application layer. It Many years ago, the military of the United States of America desired to interconnect or link
defines encryption, compression, conversion and other coding functions. Examples of their computers in order to better understand and manage information and
specifications defined at this layer are: GIF, JPEG, MPEG, MIME and ASCII. communication with respect to enemy attacks in times of crisis. In the year 1969 the
Department of Defense (DoD) then developed an experimental network called the
Layer 5: Session Advanced Research Project Agency Network (ARPANet)
It establishes, maintains and terminates end-to-end connections (session) between two In the year 1980, the National Science Foundation of the United States of America then
applications on two network nodes. It controls the dialogue between the source and developed the technology of ARPANet to produce the National Science Foundation
destination nodes, which node can send when and for how long. Examples of protocols that Network (NSFNet) which now enabled universities and other school establishments in the
operate on this layer are: RPC, NETBIOS and X.225 USA to be interconnected. After a great deal of work, a network which enabled the transfer
of large amounts of information at very high speed which is today called the Internet was
Layer 4: Transport developed.
It is responsible for end-to-end delivery of entire messages. It allows data to be transferred The Internet can be defined as a worldwide/global system of interconnected computer
reliably and uses sequencing to guarantee that it will be delivered in the same order it was networks. It is the network of networks in which users can view information on the World
sent. It also provides services such as error checking and flow control. Examples of Wide Web, exchange electronic mail, participate in electronic discussion forums
protocols at this layer are: TCP, UDP, NETBEUI and SPX. (newsgroups), send files from any computer to any other and even use each other’s
computers directly if they have appropriate passwords. Another name for the Internet is
Layer 3: Network information superhighway.
©A LEVEL ICT 51
3.2. ISP and Internet Access 3.2.4. Wireless Internet Access
An Internet service provider (ISP), also sometimes referred to as an Internet access Wireless Internet access or wireless broadband is particularly useful for mobile users. With
provider (IAP), is a company that offers Internet access to individuals and organizations. handheld devices becoming more advanced and increasingly popular, wireless access is
The ISP connects to its customers using a data transmission technology appropriate for becoming one of the major ways of connecting to the Internet. This method provides an
delivering Internet Protocol Paradigm, such as dial-up, digital subscriber line (DSL), cable “always-on connection” which can be accessed from anywhere as long as you are
modem, wireless or dedicated high-speed interconnects. geographically within network coverage. Wireless Internet access includes deploying Wi-Fi
ISPs may provide Internet e-mail accounts to users which allow them to communicate with hotspots for accessing the Internet. Technologies such as GPRS and UMTS (Universal
one another by sending and receiving electronic messages through their ISP's servers. ISPs Mobile Telecommunication System) allow Smart phones and other handhelds with Internet
may provide services such as remotely storing data files on behalf of their customers, as capabilities to access the Internet using existing cell phone networks.
well as other services unique to each particular ISP.
Different methods exist for connection to the Internet. 3.2.5. Internet over Satellite
Internet over satellite (IoS) allows a user to access the Internet via a satellite that orbits the
3.2.1. Dial-Up Connection earth. A satellite placed at a static point above the earth's surface, communicates with the
A dial-up connection is a connection that is established by dialing a telephone number ISP’s dish giving the user access to the internet.
through a modem. A dial-up connection uses a dial-up modem to transmit digital
information over thePlain Old Telephone System (POTS). POTSrefers to the standard 3.3. The TCP/IP Model
telephone network designed for analog transmission of voice over copper wire. This type The Internet uses a collection of protocols known as the TCP/IP protocol suite. It is called
ofconnection offers relatively slow transfer rates and is established on demand. This TCP/IP after two of its most prominent protocols, but there are other protocols as well. The
method has long been the most widely used method to connect to the Internet but it has TCP/IP model is based on a four-layer model for networking. The layers from top to bottom
been replaced by high-speed broadband and wireless connections. are application layer, transport layer, Internet layer and network access layer.Below is a
comparison between the TCP/IP model and the OSI model.
3.2.2. Digital Subscriber Line
DSL uses the standard copper telephone wires, often already installed in homes and offices Application Layer
to provide a high-speed Internet connection. xDSL means that there are different types of Application Layer HTTP FTP SMTP DNS RIP
DSL: asynchronous DSL (ADSL), synchronous DSL (SDSL), High bit-rate DSL (HDSL), Rate Presentation Layer
Adaptive DSL (RADSL) and ISDN DSL (IDSL). Session Layer Transport Layer
ADSL allows the telephone wires to be used for analog POTS system and digital data TCP UDP
Transport Layer (Host-to-host)
transfer simultaneously. The download speed (downstream) for ADSL is faster than the
©A LEVEL ICT 52
3.3.1. Network Access Layer 3.3.3. TransportLayer
This layer is responsible for sending and receiving TCP/IP packets on the network medium The transport layer is responsible for sequencing and transmission of packets,
(Physical/Data Link). The network Access layer PDUcalled frame, is obtained by adding a acknowledgment of receipts, recovery of packets and flow control. In essence, it engages in
header and a trailer to the PDU from the Internet layer. host-to-host transportation of data packets and the delivery of them to the application
Applicable LAN technologies: Ethernet, Token Ring, FDDI etc. layer. A transport layer PDU is called segment.
Applicable WAN technologies: X.25 (old), Frame Relay, ATM etc. Core protocols at this layer are TCP and UDP.
©A LEVEL ICT 53
A website can be accessed by typing its address or URL (Uniform/Universal Resource
f. WirelessApplicationProtocol Locator) into the address bar of a web browser. An example of a URL is
WAP is a protocol which runs on mobile phones and provides a universal open standard for http://www.crtv.cmwhere http is the protocol used and www.crtv.cm, the domain name
bringing Internet content to mobile phones and other wireless devices. (address) of the site.
Assignment: Give the full meaning of the following protocols and state their functions. Example 1: http://www.bgsmolyko.edu/Ls3,4/ict796/intenet.pdf
i) IMAP http is the protocol used (hypertext transfer protocol)
ii) RIP www.bgsmolyko.edu is the domain name (the machine at BGS Molyko that hosts the
iii) DNS website)
Ls3,4/ict796/internet.pdf is the path of the document (resource) on the host
3.4. TCP/IP Ports computer. Ls3,4 is the folder, ict796 is the subfolder and internet.pdf is the
A computer has a single physical connection to the network. All data destined for a file(resource).
particular computer arrives through that connection. However, the data may be intended
for different applications running on the computer. To identify the application for which Example 2: www.minsup.gov.cm
the data is intended, TCP requires port numbers on the host and destination for gov is the top level domain which specifies that the URL is for a government
communication. institution.
cm specifies the country in which the URL is hosted or the country in which the
Definition: A communication port is a 16-bit number that identifies an application on the institution is found.
Internet or TCP/IP network.
Assignment: What is a home page?
Popular Internet application protocols are associated with well-knownportsassigned by the Answer: A web page that links a user to the other areas of the website.
Internet Assigned Number Authority (IANA). Sample TCP port numbers are:
a. Domain Name System
Port number Protocol A domain name system (DNS) is a service which performs the function of turning human-
understandable domain names into IP addresses.
20 FTP data channel
©A LEVEL ICT 54
yahoo.com is the domain name. The domain specifies the mail server (computer) users as friends, the ease of sharing pictures, music, text, and links, and built-in chat and
on which the mail box is located. mail features. Examples of social networking sites areFacebook, Twitter and Instagram.
The part of the domain name after the dot is called top-level domain, and specifies the type c. Wikis
of organization or the country the host server is located. Some common top-level domains Wikis are websites that allow visitors to easily add, remove and edit content, hence
are: enabling the collaborative authorship of comprehensive documents. The best example of a
o .com - for commercial enterprises wiki is the multi-lingual, web-based encyclopediaWikipedia, and which currently includes
o .edu - for educational institutions and universities over two million articles.
o .gov - for United States government agencies
o .net - for organizations such as Internet Service Providers d. Viral Video Sites
o .org - for non-commercial organizations A viral video is a video that is distributed by sharing. Viral videosites are websites that
allow anybody to post videos online. Whilst it is now not difficult to put a video on any
3.5.3. Instant Messaging website, the significance of viral video sites is that they provide somewhere to put videos
Instant messaging is a live (or real time) communication which occurs when brief text where it is likely that at least some other people will actually find them. Examples are
messages are exchanged instantly over the Internet. Instant Messaging requires that both YouTube and Kaltura.
users be on-line at the same time. Common IM applications are AOL Instant Messenger,
Yahoo Messenger and Microsoft MSN messaging. 3.5.6. Electronic Commerce
E-commerce refers to the buying and selling on the Internet. Different models of e-
3.5.4. Internet Telephony commerce exists: business-to-business, business-to-consumer, business-to-government
Internet telephony or voice over IP (VoIP) is the transmission of voice telephone and m-commerce
conversations through the Internet or IP networks. It allows users to have voice-talk with
others. The telephone calls are digitized and transmitted through the Internet. Internet a. Business-to-Business
telephone services can be mainly categorized into net-to-net and net-to-phone telephony. B2C model sells goods or services to the consumer, generally using online catalog and
In net-to-net telephony, both caller and receiver must be online. When both are online, one shopping cart transaction systems. For example, an online pharmacy giving free medical
dials the other person’s phone number. If they accept the call, then voice communication is consultation and selling medicines to patients is following B2C model. Amazon is an
established. example of one of the first and still one of the most successful B2C e-commerce
In net-to-phone, only one person has to be online. This person dials the other person’s companies.
phone number and the latter receives a ring on their phone. Yahoo messenger and Skype
provide services for both types. b. Business-to-Business
B2B describes commerce transactions between businesses, such as between a
3.5.5. Interpersonal Computing manufacturer and a wholesaler, or between a wholesaler and a retailer. In this form, the
Interpersonal computing refers to person-to-person interactions facilitated by websites buyers and sellers are both business entities and do not involve an individual consumer.
that enable collaborative content creation, sharing and manipulation. Interpersonal
computing involves: blogs, social networks, wikis and viral video sites. c. Business-to-Government
B2G is a derivative of B2B marketing. B2G sites provide a platform for businesses to bid on
a. Blogs government opportunities which are presented as solicitations requests for proposal
A blog (web log) is a chronological, journal-style website which its author (or "blogger") (RFPs) to tender.
maintains like an online diary, with regular entries of commentary, descriptions of events,
or other material such as graphics or video. Many blogs provide commentary or news on a d. M-Commerce
particular subject; others function as more personal online diaries. They also provide the M-commerce refers to the use of mobile devices for conducting transactions. The mobile
readers with the ability to leave comments in an interactive format. device holders can contact each other and can conduct the business. Even the web design
and development companies optimize the websites to be viewed correctly on mobile
b. Social Networking Sites devices.
Social networking sites are websites that allow user to build personalized communities to
socialize with. Common features include a customizable profile, the ability to add other
©A LEVEL ICT 55
Some e-commerce websites are: www.bruneiair.com for airline ticket bookings, 3.7.1. HTML Documents
www.amazon.com for sales of books and magazines, www.brumedia.com/shop for sales of An HTML document is simply a text file that is saved with the extension .html or .htm. It can
computers, shirts, and cameras be created by a simple text editor like Microsoft Notepad, Notepad++ as well as a
sophisticated web authoring tool like FrontPage or Dreamweaver.
Some advantages of setting up an e-commerce website are: HTML documents are made up of markup tags (or simply tags). A tag is a code enclosed
o Products can be sold to local customers and those from abroad. within angle brackets that indicates how something is to be interpreted by a web browser.
o It is accessible 24 hours each day. Some examples of tags are <html>, <br> and <em>. Most tags come in pairs: an open tag
o It needs a small number of staff to run. and a closing tag which is written with a slash after the first < (e.g. </html>). A closing tag
o It does not need huge office space. tells the browser where to stop applying the effect of a given tag.
o Products can be sold at cheap prices An HTML document is contained within the <HTML> and </HTML> tags and comprises of
two sections: head and body.
Some disadvantages of e-commerce are: The Head contains the page title and meta-tags within the <HEAD></HEAD> tags.
o Credit card fraud - hackers are able to steal credit card numbers on computers. Any JavaScript code that is used, as well as Cascading Style Sheet information is also
o Certain websites spy or track the buying habits of their customers. contained within the Head. This section will not be displayed on the web page.
o Some goods do not arrive after they are paid for. The Body holds the actual content of the page (text, graphics, lists, etc.) contained
o It lacks human interaction as one only sees pictures and some text descriptions. within the <BODY></BODY> tags.
The <HTML>, <HEAD>, <TITLE>, and <BODY> tags are referred to as document tags while
3.5.7. Online Banking the tags that are used within the body part of the document are known as markup tags.
Online banking (Internet banking) is simply the use of the Internet to perform banking A basic HTML document would look something like this:
operations like opening an account, accessing account information, transferring funds,
getting a bank statement etc. In an Internet banking system, the bank has a centralized <HTML>
database that is web-enabled. All the services that the bank has permitted on the Internet <HEAD>
are displayed in a menu. Any service can be selected and further interaction is dictated by <TITLE>Page title here</TITLE>
the nature of service. </HEAD>
<BODY>
3.6. Intranet and Extranet Page content here.
An intranet is a private network that is set up using the same technology and protocols as </BODY>
the Internet but is restricted to users inside an organization. It provides similar services </HTML>
within an organization to those provided by the Internet without necessarily being
connected to the Internet. An intranet can be seen as a private version of the Internet. To
access an intranet, some form of user authentication is usually required. External access to o <HTML> marks the beginning of an HTML document
an intranet is not always provided. o <HEAD> begins the heading section of the document
An extranet is an interconnection of two or more intranets. It allows an organization to o <TITLE> ... </TITLE> gives a title that will appear on the browser’s menu bar. This
share information with other organizations using Internet standards but with security section must appear between the <HEAD> ... </HEAD> tags and should be straight
features preventing access to others. text, no tags.
o </HEAD> defines the end of the heading
3.7. Web Design with HTML o <BODY> … </BODY> defines the body of the document (text contained within the
HTML stands for Hypertext Markup Language. It is the authoring language that describes <BODY> … </BODY> tags appears in the main browser window). It can be used
how a Web page should be displayed by a Web browser. Hypertext means that it provides with the attribute BGCOLOR.
ways of representing information with links or connections to other information. These o </HTML> defines the end of the document
links are called hypertext links. Markup means that it provides ways to indicate
underlining, italics, paragraph breaks, section headings, and so on, in text. Remark Once an HTML document hasbeen saved, it can now be opened as a web page
using a web browser.
To edit the page, go back to the text document. Make the changes and save the document. In
the web page, click “reload” or “refresh” to apply the changes.
©A LEVEL ICT 56
3.7.2. Text Tags <strong><em><u>This text is bold, underlined and in
Text tags are used to format text within the document.Some tags are used with attributes. italics</u></em></strong>
An attribute is a special code that can enhance or modify a tag. They are generally located </body>
in the starting tag after the tag name. The basic syntax for html tags and attributes is: </html>
An object-oriented database tries to keep the advantages of the relational model and at the
same time allows applications to access structured data.
©A LEVEL ICT/Csc 58
2. Database Modeling
The basic elements of an E-R diagram are entity sets, attributes and relationship types.
2.1. DatabaseNormalization
Database normalization is the process of organizing the fields and tables of a relational
2.2.1. EntitySet
database to minimize redundancy and dependency. Normalization usually involves
An entity is a person, place, concept or thing for which we intend to collect data. For
dividing large tables into smaller and less redundant tables and defining relationships
example, a customer, an employee, a book, an appointment.
between them. Normalization works through a series of stages known as normal forms. In
A group of entities that share the same properties is an entity set.An entity is therefore a
order to achieve one level of normal form, each previous level must be met.
member or an instance of an entity set. In an E-R diagram, an entity set is represented by a
rectangle. In the above E-R diagram, PERSON and HOUSE are entity sets
2.1.1. First Normal Form
A relation (Table) is in first normal form (1NF) if and only if
2.2.2. Attribute
It contains a primary key. A primary key is an attribute that identifies each entity
An attribute is a fact about an entity or a property that describes an entity. For example, a
in a unique way.
person’s name, date of birth or gender, a vehicle’s model, color or brand. Attributes store
It contains no multivalued field or repeating groups. A multivalued field is one that may
the actual data we want to keep about each entity within an entity set. An attribute is
take several values for a single record. A repeating group is a set of one or more
represented by an ellipse. In the above E-R diagram, name and date of birth are attributes
multivalued attributes that are related.
of the entity set PERSON while Number and Street are attributes of the entity set HOUSE.
2.2. Entity-RelationshipModeling A unary relationship type is one that involves entities from a single entity set. E.g.
When a relational database is to be designed, an entity-relationship model is drawn at an the relationship MANAGES between entities within the entity set EMPLOYEE.
early stage and developed as the requirements of the database and its processing become
better understood.
Definition: An E-R model is a diagram which uses basic graphic symbols to show the Manages
organization of and relationships between data in a database.
An E-R diagram serves as a schema diagram for the required database. A schema diagram is A binary relationship type is a relationship between entities from two different
any diagram that attempts to show the structure of the data in a database. entity sets. An example is the relationship OWNS in the E-R diagram above.
Name
Number
DOB Street
©A LEVEL ICT/Csc 59
An E-R diagram
A subject is taught by one or many teachers. The cardinality of SUBJECT in the
A ternary relationship type is one that involves entities from three different entity inverse relationship IS_TAUGHT_BY, is many and the optionality is one. This
sets. An example is a LECTURER who teaches a certain COURSE in a DEPARTMENT. relationship is described as many-to-many (M:N).
(1,M) (1,N)
LECTURER Teaches COURSE TEACHER Teaches SUBJECT
(M:N) relationship
DEPARTMENT
(1,1) (0,N)
PERSON Owns HOUSE
(1:N) relationship
Where A and B are entity sets and R is the relationship type.
In the relationship RECEIVES between STUDENT and SLIP, each student receives
one andonly one result slip. The cardinality of student is one and the optionality is Exercise! Exercise! Exercise!
one. Each result slip is issued to one and only one student. The cardinality of SLIP is
one and the optionality is one. This relationship is described as one-to-one (1:1). 1) Identify the cardinality ratios of the following relationships.
(1,1) (1,1)
STUDENT Receives SLIP
(1:1) relationship
In the relationship TEACHES between TEACHER and SUBJECT, a teacher teaches one
many or subjects. The cardinality of TEACHER is many and the optionality is one.
Example: Given the 2-dimensional array Tab[4][2] below, what are the elements given by RecordName.fieldName = “”
the references Tab[0][0], Tab[1][1], Tab[3][0] and Tab[2][1]? Raissa.DOB= 01 Apr 1996
Index [0] [1]
Record data structures are always used in association with arrays. That is, we define an
[0] 5 3 array whose elements are of type record. When this is done, we have an array of records.
[1] 1 4
For example: let’s define an arrayClassList, which stores information about the students in
[2] 3 1
the table above.
[3] 2 8
StudentClassList[5] or ClassList: Array [1..5] of Student
Each individual element can be referenced by its row and column indices. For
example: An element in this type of array is referenced as follows:
Tab[0][0] = 5 ArrayName[index].fieldName
Tab[1][1] = 4
Tab[3][0] = 2 ClassList[0].Gender == F; ClassList[4].DOB == 29 Feb 1995; ClassList[3].DOB.Month == Dec
Remark A queue in which elements can be added and removed from any end is known as Agbor Stephen
a double ended queue (Deque).
A C E
Terence
Data Pointer
A binary tree that stores names
A linked list that stores characters
Linked lists make it possible to insert items in the middle of the list without moving other The topmost node in the tree is known as the root node. Each node in a binary tree may
items to make room. have at most two children or child nodes. A node that has a child is called the child's parent
node (or ancestor node, or superior). A node has at most one parent except the root node
A B E that has no parent. Nodes that have the same parent are called siblings. Every node in a tree
can be seen as the root node of the sub-tree rooted at that node.
C D P
©A LEVEL ICT/Csc US 65
Nodes at the bottom most level of the tree are called leaf nodes. Since there are at the o Search: compute ℎ( ) and see if an element exists
bottom most level, they will not have any children. o Insert: compute ℎ( ) and place element in the resulting position
o Delete: compute ℎ( ) and remove element in that position
2.1.7. HashTable Remarks! The size of the array should be preferably a prime number.
A hash table is an array in which data is stored at specific locations designated by a hash With hash tables, there always exists the possibility that two data elements will
function. A hash function is a function that transforms the value of a record key into an hash to the same integer value. This situation is known as collision. Two methods
index that corresponds to a location for storing the record. A hash function maps the set of to solve collision are separate chaining and probing (closed hashing).
input data to a set of integers. Each element to be stored in the array has a unique key that
is mapped by the hash function to a numeric value that represents an index in the array. 3. Algorithms
For example, An algorithm is a well-defined set of step-by-step instructions for solving a problem in a
Index Element finite amount of time. A set of instructions is not an algorithm if there is no definite
stopping place, or if the instructions are too vague to be followed clearly.
0 Null
Key A good algorithm:
1 Agbor - should be explicit (i.e. clear and obvious)
25
- should be precise (i.e. exact and accurate)
36 2 Kome - should be unambiguous (i.e. no doubts about what to do/ only one way of interpreting the
instructions)
3 Eyong
43 - should be effective (i.e. produce good results)
4 Epie
- should be finite (i.e. have a definite stopping place)
44
©A LEVEL ICT/Csc 66
3.1.2. Flowchart 3.2. Variables, Constants and Literals
A flow chart is a diagram that uses graphic symbols to describe the nature and flow of steps A variable is an object in a program whose value can be modified during the execution of
in an algorithm. Each step in a flowchart is followed by an arrow that indicates which step the program. In the above flow chart, x, y and z are variables.
to go next. The following symbols are used in flow charting:
A constant is an object whose value cannot be modified in the course of the algorithm or
a. Elongated circle: indicates the beginning (start) or end (stop) of the algorithm program. A constant is given a value that remains the same all through the program.
A literal is anything (numbers or text) that is usually written within double quotes. For
c. Diamond: indicates a decision that has to be made example, “Enter a number”, “The result is”.
3.3. BasicInstructions
Three basic instructions used in an algorithm are input, output and assignment
instructions:
d. Arrow: indicates the direction of flow An input instruction allows information to be typed from the keyboard. Example:
read (a, b), get (number)
An output instruction allows:
e. Parallelogram: indicates data input and output display of information on the screen
printing of information on paper
For example: write “a is greater than b” or print “b is greater than a”
f. Circle: serves as a connector The assignment statement allows a value to be assigned to a variable.A variable can
be assigned the content of another variable, a constant, a literal, an arithmetic or
Boolean expression. The symbol used is.
Example: flow chart for an algorithm that divides two numbers x and y.
Examples: / , + , + 1, 3.14
Start In an assignment statement, the value to the right is assigned to the variable in the left.
In the case of + , “ + ” is calculated and the result is assigned (kept) in the
variable sum.
Get x, y For +1, “ +1” is calculatedand the result is assigned to the variable
total,meaning that the value of total has been increased by 1.
E.g. Let = 3
Is y=0
+1 ⇒ = 3 + 1 = 4.
©A LEVEL ICT/Csc 67
Explanation Condition is a Boolean expression meaning that it can take only one of
3.4. Control Structures two values true or false. The
The logic of a program may not always be a linear sequence of statements to be executed in condition is evaluated, if it is true, Action3 is executed. If it is false, Action 2 is executed.
that order. The logic of a program may require execution of a statement based on a Note that actions 2 and 3 could be a block statements.
decision. It may repetitively execute a set of statements unless or until some condition is E Get a, b
met. Control structures specify the statements to be executed and their order ofexecution. if (a = 0) then E get a, b
Print “Error” if a <> 0 then
else if b <> 0 then
3.4.1. Sequential Control
Print b/a print b/a
A sequence control structure executes a set of instructions one after the other from the first else
to the last in the order they are given. print “Answer is 0”
else
It is possible to nest many selection structures.
print “Error: division by 0”
Syntax: begin end
Begin
statement 1 get a statement 1 Syntax: if condition1 then
statement 2 get b if condition2 then
… c a +b
statement 2
statement n print “Sum =”, c statement 1
end End else
statement 2
statement n
else
statement 3
3.4.2. SelectionControl
A selection control structure (condition control structure) chooses the instruction or Explanation If condition1 is true, we move to condition2. If condition2 is true, then
instructions to be executed based on the validity of a certain condition. Examples are IF and statement 1 is executed otherwise, statement 2 is executed. If condition 1 is false,
CASE statements. instruction 3 is executed. Instruction1 or instruction 2 will be executed if and only if
condition 1 is true.
a. The IF Statement
b. The CASE Statement
Syntax: if condition then
statement 1 statement Syntax: case variable of
else case 1: statement 1
statement 2 No Yes case 2: statement 2
?
…
case n: statement n
statement 1 statement 2 end case
©A LEVEL ICT/Csc 68
Explanation The statement(s) is(are) executed and the condition is evaluated. If it evaluates to false, the statement or set statements is/are executed again. If condition
evaluates to true, the program exits the loop.
4.3. RepetitionControl
The repetition (iteration) control structure executes a statement or group of statements many times until a certain condition is reached. Repetition structures define the order of operations
and the number of repetitions. They are also called loops. Examples are, the WHILE, REPEAT and FOR loops.
Get n i 1 repeat
print “This is a repeat loop”
i := i +1
until(i<= n)
a. The WHILE Loop
Remark! The repeat loop must be executed at least once as the condition is evaluated only at the end of the loop.
c. The FOR Loop
Explanation The condition is evaluated, if it is true statement(s) is/are executed. Instruction(s) is/are executed as long as condition remains true. When the condition becomes false,
the loop stops.
The condition for the loop to stop comprises of a variable called control or iteration
variable whose value must change at the end of each execution of the loop. In the example above, the control variable is “i”.
E Get n i 1
while (i<= n) do
print “this is a while loop”
ii +1
endwhile
©A LEVEL ICT/Csc 69
Syntax: for varlow_limi tto hi_limit do
statement(s);
end for
Or
For varhi_limit down to low_limitdo
statement(s);
end for
Explanationvar (variable) is given a value low_limit or hi_limit depending on the loop, which is automatically incremented or decremented (by 1) after each iteration of the loop. The loop
stops when low_limit becomes greater than hi_limit. In both cases, if hi_limit is less than low_limit, the loop body is not executed at all.
E Get n
Fori 1 to ndo
print “this is a for loop”
end For
b. The REPEAT Loop Or
Get n
Syntax: repeat statement(s); until (condition)
statement(s)
ori n downto 1 do
print “this is a for loop”
end For
©A LEVEL ICT/Csc 70
Exercise! Exercise! Exercise!
1) Write an algorithm that reads a number and returns the first numbers. n should be a whole number greater than 0.
2) Write an algorithm that reads a number and returns the sum of the first numbers.
5) Write an algorithm that reads a person’s name and sex, and returns the message “good morning Mr. name” if the person is a man and “Good morning Mrs. Name” for a woman.
3.5. Recursion
Some problems are recursive in nature. This means that the solution to such problems involves the repeated application of the solution to its own values until a certain condition is reached.
Algorithms for such problems are known as recursive algorithms.
A recursive algorithm is an algorithm that calls (invokes) itself during its execution. Examples are the factorial function and the sum function.
Recursion can be defined as the calling of a procedure by itself, creating a new copy of the procedure.
3.6. SortAlgorithms
Sorting is a programming technique which is used to arrange a list of pre-stored data in an ascending or descending order according to a preset criterion. There are lots of useful sorting
methods. For example: insertion sort, bubble sort, selection sort, quick sort, merge sort and heap sort algorithms.
a. Bubble Sort
Bubble sort algorithm arranges items in order as follows:
- First, examine the first two items in the list. If they are in order, leave them alone; if not, interchange them.
- Do the same with the second and third items, then with the third and fourth items, until you have reached the last two. At this point you are guaranteed that the item that should
come last in the list has indeed “bubbled” up to that position.
- Now repeat the whole process for the first (n-1) items in the list, then for (n-2)and so
on until the list is sorted.
©A LEVEL ICT/Csc 71
c. Insertion Sort
3.7. SearchAlgorithms
A search algorithm is a method of locating a specific item in a larger collection of data. They can be used to search for items within an array or list. Common search algorithms are sequential
search and binary search.
a. Sequential Search
Sequential search is a simple technique for searching an item in a list by comparing each element with the element searched for, beginning with the first element until the element is found.
b. Binary Search
4. Programming
Programming is the activity of writing computer programs. A computer program is a set of instructions that will be followed by a computer to perform a computation. These instructions are
made up of statements written in some languages specially designed for this purpose. These languages are called programming languages.
In other words, a program is an algorithm expressed in a programming language.
a. Machine Language
Machine language is the computer’s language. It is the language the computer understands. Machine language instructions are written in binary (a series of 0s and 1s), and are directly
executable by the computer. Each machine language statement corresponds to one machine action. Machine language is the first generation of programming languages. For example a
short (3 instruction) program might look like this:
©A LEVEL ICT/Csc 72
Assembly language is a low-level language consisting of mnemonic codes and symbolic o programs may be slower than second generation languages
addresses corresponding to machine language instructions. Assembly language is the o may produce larger program files for same functionality as second generation
second generation of programming languages. For example: languages.
o may not allow for low level hardware access
LOAD R0 Number1 Load number1 in register 0
LOAD R1 Number2 Load Number2 in register 1 4.2. LanguageTranslators
ADD R2 R0 R1 Add register 0 and register 1 and keep result in register 2 To run a program on a computer, the program needs to be translated into the machine
language of the computer on which it will run. A language translator is a computer program
Advantages of assembly language that translates program instructions from one programming language to another without
o It is easier to write and understand when compared to machine language. loss of original meaning. There are three types of language translators: compiler,
o It can produce small program sizes interpreter and assembler.
o It can produce very fast code as it allows low-level access to hardware features
4.2.1. Assembler
Disadvantages of assembly language An assembler translates assembly language into machine language. The process is called
o Programs are not as easy to write and understand when compared to high level assembling.
languages.
o Programs are tied to specific computer hardware and can’t be reused on another
kind of computer.
o Writing programs is very time consuming, tedious, and error-prone.
4.4. ProgrammingParadigms
A programming paradigm (or technique) is a fundamental style of computer programming.
It describes a programming language’s approach to solving a problem. Paradigms differ in
the concepts and abstractions used to represent the elements of a program and the steps
Program interpretation that compose a computation. High level languages can be classified under four different
paradigms: procedural, functional, object-oriented and declarative paradigms.
Advantages of an Interpreter
o It is good at locating errors in programs 4.4.1. Procedural Paradigm
o Debugging is easier since the interpreter stops when it encounters an error. In the procedural/imperative paradigm, a program is a collection of statements and
o If an error is corrected, there is no need to retranslate the whole program procedures that affect data. Here, a program can be seen as an active agent that
manipulates passive objects(variables).These objectsarepassive because they cannot
Disadvantages of an Interpreter initiate an action by themselves, but can only receive actions from active agents.The focus
o It is slow as interpretation and execution is done line by line. in procedural programming is to write good functions and procedures.
o Translation has to be done every time the program is to be executed since no Examples of imperative languages are Pascal, C, Ada, FORTRAN, and COBOL.
object code is produced.
o For the program to run, the interpreter must be present 4.4.2. Object Oriented Paradigm
The object-oriented paradigm presents a program as a collection of classes for interacting
4.3. Program Errors and Correction objects. Unlike in imperative programming, object-oriented programming deals with active
4.3.1. Syntax Errors objects instead of passive objects. These objects are active because the actions to be
Syntax is the set of rules that specify how the symbols of a language can be put together to performed on the objects are included in them (the objects). The objects need only to
form meaningful statements. In other words, syntax defines the structure of legal receive the appropriate stimulus from outside to perform one of the actions.
statements in a language. A syntax error is an error in a program that occurs due to the Examples of object-oriented languages are C++, Java, Visual Basic and Smalltalk.
non-respect of the syntax rules of the language used. A syntax error will cause a Some important concepts related to object oriented programming (OOP) are: class, object,
compiler/interpreter to stop trying to generate machine code and will not create an abstraction, encapsulation, inheritance and polymorphism.
executable. However, a compiler will usually not stop at the first error it encounters but
will attempt to continue checking the syntax of a program right to the last line. For a. Class
example, a misspelled key word, a missing punctuation mark or the incorrect use of an A class is a description of an object or a real life concept. Classes are templates for creating
operator is a syntax error. objects, providing initial values for instance variables (attributes) and the bodies for
methods. All objects generated from the same class share the same methods, but contain
4.3.2. SemanticErrors separate copies of the instance variables. New objects can be created from a class by
Semantics specify the meaning of a well-formed program. A semantic error occurs when applying the new operator to the name of the class.
you write a program that works, but does not do what you intend it to do. Compilation and
interpretation do not detect semantic errors. Semantic or logicerrors are detected from Class Person {
wrong results. Something may be syntactically correct but semantically incorrect. private:
charname[20];
charsex;
©A LEVEL ICT/Csc 74
datebirthdate;
public: Inheritance is usually represented using an inheritance diagram.
updateInfo(); For example: if the classesStudent and Teacher are derived from the superclass Person, this
returnAge(); is represented as:
};
Person Person
The name of the class is person. It has four instance variables (attributes)name,sexand age,
and three methods: updateInfo(),and returnAge(). These methods act on the instance
variables when invoked. Student Teacher
b. Object There are two types of Inheritance: multiple inheritance and multilevel inheritance.
An object is an instance of a class. An object consists of a collection of attributes,
representing the state of the object, and a collection of methods, representing the behavior Multiple inheritance iswhen a derived class inherits features from more than one
that the object is capable of performing. Attributes are sometimes referred to as the fields superclass. It is illustrated as follows:
of an object. The methods are routines that are capable of accessing and manipulating the
values of the attributes of the object. Objects interact with each other by sending messages. Base class 1 Base class 2
When a message is sent to an object, the corresponding method of the object is executed.
Derived class
c. Abstraction
d. Encapsulation Multi-level inheritance is when a class inherits from a class which is itself
Encapsulationis the process of combining together the attributes and methods of a class inherited from another class. It is illustrated as follows:
into a single abstract data type with a public interface and a private implementation. The
goal of encapsulation is to protect the implementation from the users of the object. It Base class
ensures that all access to the internal representation of the object pass through the class
methods, which act as an "interface" to the object. This is done by making properties and
methods “private.” Derived class 1
e. Inheritance
Derived class 2
Inheritance is the derivation of one class from another so that the attributes and methods
of the derived class are part of the definition of the initial class. The initial class is often
called the base class, parent class or superclass while thederived class is often referred to
as the child class or sub-class. The subclass usually contains all the attributes and methods f. Polymorphism:
of the superclass plus some of its own. Polymorphism is the use of different methods, each with the same name, which are
For example: the class Student inheriting from the class person will have all the attributes associated with different object types. In other words, it is the ability for different objects to
and methods of Person plus the following: respond to the same message in different, class-specific ways. Polymorphic methods are
used which have one name but different implementations for different classes.
Class Student extends Person { Assume you have a “shape” superclass. This class has a method called “area” which returns
private the area of the shape. Polymorphism allows you to make subclasses like “circle,” “square,”
intadmNumber; and “triangle” which inherit the “area” method, but each subclass would return the correct
intlevel; value even though they have different formulas to calculate their areas.
public
changeLevel(intnewLevel) { 4.4.3. FunctionalParadigm
level=newLevel; In functional (applicative) programming, a program is a collection of function definitions.
} Lambda calculus forms the basis of almost all functional programming languages. Lambda
}
©A LEVEL ICT/Csc 75
calculus is the use of lambda expressions to define functions. A lambda expression is a 4.5.1. Basic Structureof a C Program
formula that defines a function. For example: ( ) = +2 A C program is made up of the following components:
Examples of functional languages are Haskell, LISP, ML and Scheme. Processor directive
Declaration of variables
Sum function in Haskell Declaration of functions
Function main()
∶: ( , )→
Definition of functions
( , )= +
©A LEVEL ICT/Csc 76
o int sum=0 indicates that variables can be assigned values when they are declared.
b. Declaration of Variables This is called initialization. Therefore, one can initialize a variable at the time of
A variable is a memory location reserved to contain a value that may change during the declaration.
execution of the program. Variables are used for storing input data or values generated as o i and j are integers with j initialized at 2.
result of
Type Description processing. Variable declaration serves two purposes:
1. Char a single ASCII character Variables are o It gives the compiler precise information about the amount of memory that will
2. int standard integers (usually 32 bits) characterized have to be given over to a variable when a program is finally run and what sort of
3. long int (long) long integers by their name, operations will have to be used on it.
4. Float standard floating point or real numbers type and o It provides the compiler with a list of the variables in a convenient place so that it
5. long float (double) long floating point numbers scope. can cross check names and types for any errors.
6. unsigned int positive short integers
unsigned float positive standard floating point VSome basic C types are:
7. ariable
numbers
8. unsigned long positive long integers Names
unsigned double positive long floating point numbers A variable’s
9.
name or
identifier in C can be anything from a single letter to a word. However, it must begin with a
letter or the underscore character but the other characters in the name can be chosen from
the following sets:
a ..z (any letter from a to z)
A .. Z (any letter from A to Z)
0 .. 9 (any digit from 0 to 9)
_ (the underscore character)
Examples of valid variable identifiers are: x, total, area_of_circle, x1, _a and aX.
Remark! C is case sensitive, so the identifiers sum and SUM are different. Same for total C fun!
The bank said they couldn’t FLOAT our loan because we were LONG on
and Total. All key words must be in lower case.
debt and SHORT of funds. Our application was UNSIGNED, so the whole
deal was VOID. Can you believe it? The bank rejected us in C-speak!
Variable Types
Every variable has a type. The type of the variable specifies what sort of data will be stored
in it. The type of a variable is specified during its declaration. To declare a variable in C, one Scope of a Variable
writes the type followed by the variable name or identifier. The scope of a variable describes where in the program the variable can be legally used.
The general syntax for declaring a variable is: Based on its scope, a variable can be global or local.
A global variable is a variable that can be recognized anywhere in the program. Global
[Type] [Name of variable] variables are declared before the function main().
A local variable is a variable that has meaning only within a particular function or other
For example: program unit. Local variables can be declared anywhere following the opening brace ({) of
int age; a block. The name of a local variable can be used in another block elsewhere in the
float area; program, where it will refer to an entirely different variable.
int sum = 0;
inti,j=2; c. The Function main( )
The function main() indicates the beginning of the actual C program. It is the point at which
o int specifies that the variables age and sum are integers while float specifies that execution of program is started. When a C program is executed, the execution control goes
the variable area is a floating point (real or decimal) number.
©A LEVEL ICT/Csc 77
directly to the function main(). Every C program must have a function main(). The general
syntax is: 4.5.2. Input/Output Statements
int main()
a. The scanf Function
{declaration of local variables;
scanf (print-formatted) is used to interpret characters input to the computer and to store
program statements;
return 0; the interpretation in the specified variable(s).
}
Example:
The keyword “int” is used before the main() function to indicate the type of the scanf("%d", &x);
value that is returned by the main() function. By definition, a function may accept
no, one or more inputs and returns no or a single value. 'int' means that the program This statement reads a decimal integer from the keyboard and stores the value in the
will return an integer value after its execution. The word “void” can be used in the memory address of the variable x.
place of “int” to indicate that the program will not return any value. In the statement,
It is good practice to always return a value because the operating system uses the %d is a conversion specifies and specifies that the variable to be readis of type
return value to determine whether the program has been executed successfully or integer. Other conversion specifiers used in C are %f for floating point numbers, %c
not. for characters and %s for strings.
The body of the main() function must be enclosed in braces (or curly brackets { }). &gives the address of something in memory. That is, it generates a pointer to the
These braces are called delimiters. The left brace indicates the start of the body of object.The arguments to scanfmust be pointers (addresses), hence the need for &.
the function whereas the matching right brace indicates the end of the body of the
function. Braces are also used to indicate the beginning and ending of block b. The printf Function
(compound) statements. printf(print-formatted) is used to display information on the screen.
Remark! The use of 'void' or 'int' before the function main() is optional. If it is not Example:
specified, the compiler assumes it is int. printf("The radius is %f cm",x);
The body of the function main() is made up of program statements which in the statement,
represent instructions to be executed by the computer. An instruction may be an “The radius is %f cm” is the control string. The text in between the double quotes
input/output statement, an arithmetic statement, a control statement, a simple will be displayed except the conversion specifier %f.
assignment statement or any other statement.
x is the variable to be printed. The value of x will be printed where the conversion
A basic C program looks like this: specifier is placed in the control string.
#include <header.h> #include <stdio.h> Many conversion specifications can be used in a control string. In this case, the
#define symbolic constant
programmer has to ensure that both the number of conversion specifications and the
Global declarations int main()
number of variables to be printed are the same and, of the correct type specified.
void main() {
{ local declarations printf(“Welcome to the world of C!”);
program instructions; return 0; Example:
} } printf(“The sum of %d and %d is %d”, x, y, x+y).
If x=2 and y=3, then what will be displayed on the screen is: The sum of 2 and 3 is 5
C fun!
C programmers know that the real reason the Roman
empire fell was that, because they had no number zero,
they had no way to successfully return from C programs.
©A LEVEL ICT/Csc 78
c. Common Conversion Specifiers b. Relational Operators
Relational operators are used for comparisons. Expressions that use these operators
Character Form of output produce a true or false value when they are evaluated.
c Character
d Decimal integer Operator Description Example
f Normal floating point If a == 2 and b== 5; a == b evaluates to
1. == Equal to
FALSE
s String
2. < Less than a < b evaluates to TRUE
e Scientific notation floating point
3. > Greater than a > 5 evaluates to FALSE
4. <= Less than or equal to b <= 5 evaluates to TRUE
Examples: scanf(“%s”,
&Name); printf(“Name: 5. >= Greater or equal to a >= 5 evaluates to FALSE
%s”, Name); scanf("%d 6. != Not equal to a != b evaluates to TRUE
%d",&x,&y);
printf("The sum of %d and %d = %d",x,y,z); c. Logical Operators
Logical operators are used to combine logical values.
d. Character Input/Output
getchar and putchar are used for the input and output of single characters respectively. Operator Description Example
getchar() returns an int which is either EOF (indicating end-of-file) or the next character in 1. && Logical AND (a>b) && (a>C)
the standard input stream
2. || Logical OR If ((a ==0) || (a ==1)), printf(“a!=1”);
putchar(c) puts the character c on the standard output stream
3. ! Logical NOT (Negation) If found == 1 (true), !(found) == 0 (false)
#include<stdio.h> 4. & Bitwise AND 4 & 5 = 0100 & 0101 = 0100 = 4
main() 5. | Bitwise OR 4 | 5 = 0100 | 0101 = 0101 = 5
{ charch; 6. ^ Bitwise XOR 3 ^ 9 = 0011 ^ 1001 = 1010 = 10
ch=getchar();
printf(“%c”,ch); Remark! Bitwise operators allow manipulation of the actual bits held in each byte of a
} variable. Other bitwise operators are:
©A LEVEL ICT/Csc 79
The variable is assigned the value 3.14 and the variable sum is incremented by 1. Syntax: if(expression)
statement(s);
C has different types of assignment operators.
Operator Description Example and
1. = assign c=2
2. += Assign with add = + ≡ += if (condition)
3. -= Assign with subtract = − ≡ -= {
statement(s);
4. *= Assign with multiply = ∗ ≡ -=
}
5. /= Assign with divide = / ≡ /=
else
6. %= Assign with remainder = % ≡ %= {
7. >>= Assign with right shift >>= b statement(s)
8. <<= Assign with left shift <<= b }
9. &= Assign with bitwise AND = & ≡ &=
In the first form, if the expression specified in the if statement evaluates to true, the
10. |= Assign with bitwise OR = | ≡ |=
statements inside the if-block are executed and then the control gets transferred to the
11. ^= Assign with bitwise XOR = ^ ≡ ^=
statement immediately after the if-block.
In the second form, the else part is required only if a certain sequence of instructions needs
e. Increment and Decrement Operators to be executed if the expression evaluates to false.
Increment and decrement operators give a shorthand method of adding and subtracting 1
from an object respectively. scanf(“%d”,&b);
if (b>0)
++ Increment ++≡ = +1 printf(“Number %d is positive”,b);
-- Decrement -- ≡ = − 1 else
printf(“Number %d is negative”,b);
These operators can be prefix or postfix. With the prefix form the variable is changed
before the value of the expression in which it appears is evaluated, and with the postfix The expression is always enclosed within brackets.
form the variable is modified afterwards. If statement(s) is a single statement, the curly brackets can be omitted as in the
= 3; = 3; example above though it is good practice to always enclose them with curly
= +++ 6; /* a = 9, b = 4 */ = ++ + 6; /* a = 10, b = 4 */ brackets.
Sometimes we may want to evaluate more than one thing in an expression. This can be
4.5.4. Control Flow Statements done in C by using the logic operators AND and OR.
Control flow statements make it possible to make decisions, to perform tasks repeatedly or
to jump from one section of code to another. C control flow statements are If statement, For example:
switch statement, while statement, do … while statement, for statement and jump if (a==0 || b==1)
statements. This expression is TRUE if a is 0 OR b is 1. It is also true if = 0and = 1.
C Fun!
Shakespeare must have been disappointed to learnthat, whatever
the value of a variable tobe, the result of the question tobe || !tobe,
isalwaystrue. Fortunately, thisis not a question of life or death!
©A LEVEL ICT/Csc 80
case, all the cases after case 3 would also get executed along with case 3. If break is present
only the required case is selected and executed; after which the control gets transferred to
b. Nested IF the next statement immediately after the switch statement. There is no break after
It is also possible to embed or to nest IF statements one within the other. Nesting is useful defaultbecause after the default case the control will either way get transferred to the next
in situations where one of several different courses of action need to be selected. statement immediately after switch.
Example: #include<stdio.h>
#include<stdio.h> int main()
int main() { int a, b; char op;
{ int a, b; printf("Enter two integers: ");
scanf(“%d %d ”, &a,&b); scanf(“%d %d”, &a, &b);
if(a>b) printf("Enter an operator: ");
{ scanf("%c", &op);
printf("%d is greater.", a); switch(op)
} {
else case+: printf("%d +%d = %d ", a, b, a+b); break;
if(a==b) case-: printf("("%d - %d = %d ", a, b, a-b); break;
{ case*: printf("("%d * %d = %d ", a, b, a*b); break;
printf("%d and %d are the same: ", a,b); case/: printf("%d / %d = %f ", a, b, a/b "); break;
} default: printf("Error!");
else }
{ return 0;
printf("%d is greater.", b); }
}
return 0; Remark! If you need to select among a large group of values, a switch statement will run
} much faster than a set of nested IFs.
The switch differs from the IF in that switch can only test for equality, whereas IF can
c. SWITCH Statement evaluate any type of Boolean expression.
A switch statement is used for multiple way selections that will branch into different code
segments based on the value of a variable. d. WHILE Statement
The While statement or while loop is an iteration statement. Iteration statements are used
Syntax:switch(variable) to execute a particular set of instructions repeatedly until a particular condition is met or
{ for a fixed number of iterations.
casevalue1 : code segment1; break;
casevalue2 :code segment2; break; Syntax:while (condition)
… {
casevalueN : code segment N; break; statements;
default: statement(s); }
}
The statement or statements are only executed if the expression is true (non-zero). After
If the value of the variable equals ‘value1’, code segment1 is executed. Otherwise, if it every execution of the statements, the expression is evaluated again and the process repeats
equals value2, code segment2 is executed and so on. if it is true.
The statement break is used after every case in order to prevent execution from continuing
into the code segment of the next case without even checking its value. Example:
For example, supposing a switch statement has five cases and the value of the third case inti=1;
matches the value of expression. If no break statement were present at the end of the third while(i<=10)
©A LEVEL ICT/Csc 81
{ Example: A program to print the sum of the digits in a number.
printf(“%d”, i);
i++; #include<stdio.h>
} int main()
This code will loop 10 times writing the numbers 1 to 10. { int n, a,sum=0;
printf("Enter a number:");
Example: A program that counts the number of blank spaces in a line of text. scanf("%d", &n);
do{
#include <stdio.h> a =n%10;
int main() sum=sum+a;
{ charch; short count = 0; n=n/10;
printf("Type in a line of text\n"); } while(n>0);
while((ch = getchar()) != '\n') printf("Sum of the digits = %d",sum);
{ return 0;
if(ch == ' ') }
count++;
} A practical use of the do-while loop is in an interactive menu-driven program where the
printf("Number of spaces = %d\n",count); menu is presented at least once and then depending upon the choice of the user, the menu
return 0; is displayed again or the session is terminated. Consider the same example that we saw in
} switch-case. Without using an iteration statement like do-while, the user can choose any
option from the menu only once. Moreover, if a wrong choice is entered by mistake the user
e. DO… WHILE Statement doesn’t have the option of entering his choice again. Both these faults can be corrected by
The do-while statement evaluates the condition at the end of the loop after executing the using the do-while loop.
block of statements at least once. If the condition is true the loop continues, else it
terminates after the first iteration. f. FOR Statement
The FOR statement or the FOR loop repeatedly executes a set of instructions that comprise
Syntax:do { the body of the loop until a particular condition is satisfied.
statements to be executed;
} while(expression); Syntax: for(initialization; termination; increment/decrement;)
{
Remark! statements to be executed;
Pay attention to the semicolon which ends the do-while statement. }
The difference between while and do-while is that the while loop is an entry-
controlled loop - it tests the condition at the beginning of the loop and will not The initialization expression initializes the looping index which controls the looping
execute even once if the condition is false, whereas the do-while loop is an exit- action. The initialization expression is executed only once, when the loop begins.
controlled loop - it tests the condition at the end of the loop after completing the The termination expression represents a condition that must be true for the loop to
first iteration. continue execution.
The increment/decrement expression is executed after very iteration to update the
value of the looping index.
#include <stdio.h>
int main()
{ int a, b, i, prod=0;
scanf(“%d”,&a);
©A LEVEL ICT/Csc 82
scanf(“%d”,&b); printf(“%d”, A[1]); //prints the second element of the array.
printf(“%d”, A[2]); //prints the third element of the array.
for (i=1;i<=b;i++) …
prod=prod+a; printf(“%d”, A[n-1]); //prints the last element of the array.
Where A[0] is the first element in the array, A[1] the second element, A[2] the third As separate variables
element and A[9] the last element.
M[0][0] = 2; //element on row 1, column 1
Values can be assigned to the array as if each element were a separate variable. M[1][2] = 5 //element on row 2, column 3
A[0] =3; A[1] =1; A[2] =0; … A[9] =-5
Using nested loops
A loop can as well be used.
For example: int main( )
int main() { inti, j, n=3, m=4;
{ inti, n=10, A[n] for(i=0; i<n; i++)
i=0; for(j=0; j<m; j++)
while(i<=n) {
{ printf(“M[%d][%d] = ”, i, j);
printf(“Enter element at position %d”, i); scanf(“%d %d”,&M[i][j]);
scanf(“%d”,&A[i]); }
i++; return 0;
} }
return 0;
} The elements of a 2-dimensional array can be displayed using nested loops or as separate
variables.
To display the individual elements of the array A, we can proceed as follows. Using nested loops, we have
printf(“%d”, A[0]); //prints the first element of the array.
©A LEVEL ICT/Csc 83
int main( ) For example:
{ inti, j, n=3, m=4;
for(i=0; i<n; i++) FloatareaCircle(int r) int square(int r)
for(j=0; j<m; j++) { float area; { intsqr;
printf(“M[%d] [%d]=%d ”, i, j, M[i][j]); area = 3.14*r*r; sqr=r*r;
return 0; return (area); return (sqr);
} } }
A function that has been defined can be called within the function main()or within any
4.5.6. User-Defined Functions other function.
A user defined function is a subprogram written by the user to perform a specific task. User
defined functions have to be declared and defined. They are declared before the function For example:
main but, may be defined (written)at declaration or after the function main().
#include<stdio.h> #include<stdio.h>
Float areaCircle(int) //prototype int square(int) //prototype
a. Function Declaration
A function declaration (also called function prototype) is simply a statement which
int main() int main()
specifies the function’s type, name and parameter or argument list. Function names follow
{ float area; int rad; { int a, b;
the same rules as variable names. The general syntax for declaring a function is:
scanf(“%d”, &rad); scanf(“%d”, &a);
area = areaCircle(rad); b = square(a);
TypefunctionName(parameter list, if any)
printf(“The area is %f”,area); printf(“The square of %d is %d”,a,b)
return 0; return 0;
Type refers to the type of the value the function returns.
} }
Parameters or arguments refer to the function’s inputs. A function may take no
parameter, one or more parameters and returns no or a single value. If a function
returns no value, it is of type “void”. If the function takes in any parameters, their Remarks!
types and names are specified (declared) within the brackets. If the type of a function is not specified, C will always assume that the function is of
Example: typing.
intsquare(int n) a function which takes an integer and returns its square ( ). Notice that the function area Circle was declared in the variables section of the
intpower(int b, int n) a function which takes two integers and and returns function main(). Thesis because, if a function whose type is not int is not declared in
chargetchar() a function that takes no parameter and returns a character. the variables section of the function in which it is called, compilation errors will
occur.
Remark! Parameter names are optional in a function prototype, so for the above The names used by a function for its parameters are local to the function, and are
prototypes we could have written: not visible to any other function: other routines can use the same names without
int square(int) conflict. This is also true of the variables declared within the function.
int power(int, int) When a function is called, parameters are passed to the function as inputs. In the
above examples, and are passed to the functions area Circle and square
b. Function Definition respectively.
Function definition consists of writing the actual statements of the function. A function These parameters which replace the formal parameters when a function is called
definition has the form: are passed either by value or by reference. A parameter is passed by value when the
value of the parameter is calculated and this is passed into the function. A parameter
TypefunctionName(parameter list, if any) is passed by reference by using pointers. Pointers are addresses.
{
localdeclarations; declaration of local variables
statements; function statements
}
©A LEVEL ICT/Csc 84
1.2. System Analysis
Systems analysis is an in-depth study of end user information needs which produces
XII. SYSTEM DEVELOPMENT AND PROJECT MANAGEMENT functional requirements that are used as the basis for the design of a new information
system. System analysis describes what a system should do to meet the information needs
Introduction of users. It involves:
Most computer-based information systems are conceived, designed, and implemented
using some form of systematic development process called software development process. 1.2.2. Analysis of the Old System
In this process, end users and system analysts design systems based on an analysis of the Analysis of present system involves:
information requirements of the information system to be built. The software development Collecting factual data about the present system (questionnaires, interviews,
process is also called system development life cycle. observations, etc.)
Identifying how input, processing, storage and output are being accomplished.
1. Software Development Life Cycle Analyzing how the present system uses resources (hardware, software and people)
SDLC is a structured step-by-step approach for creating and maintaining information to convert input data into useful information
systems. It consists of a number of stages that describe the activities involved in an Understanding information flow within the system
information system development process. SDLC involves the following stages: system Identifying problems with the system
study, system analysis, system design, development and testing, implementation, and
maintenance. 1.2.3. Functional Requirements Analysis
Functional requirements explain what has to be done by identifying the necessary tasks,
System Study
actions or activities that must be accomplished.
It involves:
Determining specific information needs
Maintenance System Analysis Determining the information processing capabilities required for each system
activity (input, processing, output, storage, and control) to meet the needs. The goal
here is to identify “what” should be done not “how” to do it.
Implementation System Design Determining functional requirements (information requirements that are not tied to
the hardware, software, and people resources that end users presently use or might
use in the new system).
Development
and Testing 1.2.4. Feasibility Analysis
Feasibility analysis is a study which investigates the information needs of prospective users
System Development Life Cycle
and determines the resource requirements, cost, benefits, and workability of a proposed
project. Its goal is to evaluate alternative systems and propose the most feasible and
1.1. System Study desirable system for development.
System study is a brief investigation of the system under consideration that gives a clear Feasibility of a system can be evaluated in terms of four major categories: organizational
picture of what actually it is. During this phase, the system is evaluated and deficiencies are feasibility, technical feasibility, economic feasibility and operational feasibility.
identified. This can be done by interviewing users of the system and consulting with a. Organizational feasibility focuses on how well a proposed information
support personnel. Main activities at this stage are: system supports the objectives of the organization and its strategic plan for
Determining whether a business problem or opportunity exists. i.e. identifying information systems.
problems and opportunities. b. Technical feasibility focuses on the reliability/capabilities of the hardware
o A problem is a basic condition that is causing undesirable results and software to meet the needs of the proposed system, and whether they
o An opportunity is a basic condition that presents the potential for desirable can be acquired or developed in the required time.
results. c. Economic feasibility focuses on whether the tangible costs and benefits of the
Conducting a preliminary feasibility study to determine whether a new or improved proposed system will exceed the costs of developing and operating it.
information system is a feasible solution. d. Operational feasibility focuses on the ability of the end users to operate, use,
Developing a project management plan and obtaining management approval. and support the proposed system.
©A LEVEL ICT/Csc 85
o Detailed specifications of the procedures needed to meet the user interface and
The outcome of a feasibility analysis is a feasibility report which is presented to the user data design specifications.
management for approval. It may be accepted or accepted with modifications or rejected. o Detailed specification of the database schema (E-R diagram, object diagrams)
1.2.5. Documenting System Analysis The design stage is very important because it is the place where quality is fostered in
The outcome of systems analysis is a system proposal or requirements specification software engineering. Design provides us with representations of software that can be
document which describes what the new system should do without specifying how to do it. assessed for quality. Design is the only way that we can accurately translate a customer's
At the end of systems analysis phase, the system analyst produces a system proposal that requirements into a finished software product or system.
will be used as basis for the design phase.
1.4. Development and Testing
1.3. System Design Once the design of the system is complete, it has to be converted into a computer
Systems design consists of design activities, which produce systems specifications understandable form.
satisfying the functional requirements developed in the systems analysis stage. While
system analysis specifies what is to be done by the new system, system design describes 1.4.1. Coding (programming)
how the system will accomplish what is to be done. Coding is an important activity by which a programmer converts the systems specifications
System design focuses on three main activities: user interface design, data design and from the design stage into computer instructions referred to as programs. It is generally felt
process design. that the programs must be modular in nature. This helps in fast development, maintenance
and future change if required.
1.3.1. User Interface Design
A user interface is a means of interaction between the user and the computer-based 1.4.2. Prototyping
application. This activity focuses on designing how data will be introduced into the system Prototyping is the rapid development and testing of a working model of a product in an
and how the information generated will be retrieved. It produces detailed specifications for interactive and iterative process involving both systems analysts and end users. This
information products such as: working model or prototype, is a partially developed product that enables customers and
o Display screens developers to examine some aspects of the proposed product and decide if it is suitable for
o Interactive user/computer dialogues a finished product.
o Forms (on-screen forms for data input and output) Various types of prototyping exist.
o Reports (on-screen and printed)
a. Throw-away Prototyping
1.3.2. Data Design In throw-away prototyping, the prototype is discarded once the actual requirements have
Data design focuses on the design of the structure of data and files to be used by the been understood and the final system is developed with a much clear understanding of
proposed (new) system. It provides detailed descriptions of: user requirements.
o Attributes (characteristics) of the entities about which the proposed system needs
to maintain information. b. Evolutionary Prototyping
o Relationships between these entities (E-R diagrams, data flow diagrams) In evolutionary prototyping, a functional prototype with minimal functionality is built in
o Specific data elements (databases, files, records, etc.) that need to be maintained the beginning and is refined over time, as requirements are better understood.
for each entity.
o Data dictionary c. Incremental Prototyping
o Integrity rules (data validation and verification) that govern how each data In incremental prototyping, functional prototypes of the various subsystems are built and
element is specified and used in the system. then integrated to form a complete system. In other words, the product is built as separate
prototypes which are later merged into a final product.
1.3.3. Process Design
Process design focuses on the design of software resources, that is, computer programs and 1.4.3. Testing
of procedures needed by the proposed system. It concentrates on developing detailed Testing is the process of executing a program with the intent of finding an error. During
specifications for the program modules that will have to be purchased as software testing, trial runs are done to check for errors and whether or not the new system meets
packages or developed by custom programming. Process design produces: the users' needs. Once source code has been generated, the software must be tested to
o Detailed specification of algorithms (pseudo-codes, flow charts, etc.) uncover and correct as many errors as possible before delivery.
©A LEVEL ICT/Csc 86
There are three sets of data that can be used to test the system: normal data and abnormal User documentation is a complete description of the system from the user’s point of view
data. detailing how to use or operate the system. It could be a paper-based user manual or help
o Normal data is data which the system will accept. incorporated into the software that can be accessed when the software is installed. User
o Abnormal (erroneous) data is invalid data which the system will reject. documentation always covers the following:
o Extreme data are data values that are chosen at the absolute limits of the normal o A guide that describes what the system is supposed to do in non-technical terms
range. This is to ensure that all normal values will be accepted and processed o Instructions for installing and running the program
correctly. o Definition for hardware and Operating System requirements
o The format of the output data
Using these test data, the following test runs can be carried out: o Explanation of common error messages and how to recover from them
o Description of how to make backups against accidental data loss
a. Unit Testing
The individual units or modules are tested separately with prepared test data so that any b. Technical Documentation
errors can be corrected. Technical documentation is a description from the designer’s point of view. Technical
documentation often contains:
b. Integration Testing o Detail functioning of the software showing algorithms, formulae, source codes etc.
The complete system is tested after the individual units have been tested and put together. o Description of data structures
This tests that separately developed modules/units work together as planned without o Test plans and testing procedures
error. o User interface and reports
o Location and version of the software
c. System Testing
The integrated system is tested to evaluate the system's compliance with specified 1.5. Implementation
requirements. Implementation is the conversion from the use of the present (old) system to the operation
of the new system. It involves:
d. Black-Box Testing Installation of new system
Black-box testing is a test that relies on the input/output behavior of the system, without Loading of data into new system
any assumptions to what is happening within the system. It examines some fundamental Education and training of users of the system
aspects of a system with little regard for the internal logical structure of the system. Black-
box tests are used to demonstrate that system functions are operational, that input is There are different types of conversions:
properly accepted and output is correctly produced, while at the same time searching for
errors in each function. a. Direct cutover
The old system is completely replaced by the new one. Its disadvantage is that, if the new
e. White Box Testing system fails, there is no back-up system, so data can be lost.
White-box testing, also called glass-box testing, is a test that relies on information about
how the system has been designed and constructed. It requires knowledge of the internal b. Pilot run
structure or implementation of the system. White-box tests are conducted to ensure that The new system is installed in one part of the business or organization. This allows the new
internal operations are performed according to specifications and all internal components system to be fully developed and tested. Once the pilot system is running successfully, the
have been adequately exercised. new system is introduced to all of the business/organization.
o Its advantages are that, if something goes wrong with the new system, only a small
1.4.4. Documentation part of the organization is affected, and the staff that were part of the pilot scheme
The job of the programmer does not end with the code or software instructions. The can help train other staff.
organization or users need to know how to get the best out of the system. This is done o As a disadvantage, there is no back-up system for the office/department doing the
through documentation. System documentation ensures continuity of the system. pilot, if things go wrong.
There are two types of documentation; user documentation and technical documentation.
c. Parallel run
a. User Documentation The old and new systems are operated alongside each other (in parallel) until new system
is proven capable.
©A LEVEL ICT/Csc 87
o It is advantageous in that, if the new system fails, the old system will act as a back- 2.1. Waterfall Model
up. Also, the outputs from the old and new systems can be compared to check that The waterfall model is the most common and classic of SDLC models. It illustrates the
the new system is running correctly. software development process in a linear sequential flow; hence it is also referred to as a
o Its disadvantage is that, entering data into two systems, and running two systems linear-sequential life cycle model. In the waterfall model, each phase must be completed in
together, takes a lot of extra time and effort. its entirety before the next phase can begin. At the end of each phase, a review takes place
to determine if the project is on the right path and whether or not to continue or discard
d. Phased implementation the project.
The new system is installed in phases (stages or steps) gradually replacing parts of the old
system until eventually, the new system takes over. Requirements
o Its advantages are that, it allows users to gradually get used to the new system, and
training of staff can be done in stages. Analysis
o Its disadvantage is that, if a part of the new system fails, there is no back-up
system, so data can be lost Design
Activities with the same earliest and latest start times (ES=LS) or with same earliest and 1. Draw the corresponding PERT diagram for this project
latest finish times (EF=LF) define the critical path. This means that these activities have a 2. Determine the critical path
float time of 0. 3. Calculate the total estimated duration of the project
4. State the float time for all non-critical activities
For the above network diagram, we have:
Exercise 2: Find the critical path for each of the activity networks below.
Start times Float a.
Activity Duration
Earliest Latest time
A 7 0 0 0
B 2 0 5 5
C 15 0 12 12
E 10 7 7 0
D 8 17 17 0 b.
F 2 25 25 0
G 5 17 19 2
H 8 22 24 2
I 2 27 27 0
J 3 29 29 0
c.
Finish 32 32
Exercises! a. Construct an activity network for this problem and by finding the critical path in
Exercise 1: A project has been defined to contain the following list of activities along with your network, show that the news item can be ready before 6 pm that day.
their required times for completion. b. Construct the corresponding Gantt chart for this project
Exercise 2: At 4:30 pm one day CRTV news team hears of a Government Minister
resigning. They wish to prepare an item on the event for that evening’s 6 o’clock news.
The table below list the jobs needed to prepare this news item, the time each job takes
and the constraints on when the job can commence.
Time
Job Constraints
needed
A - Interview the 15 mins. Starts at 4:30 pm