Está en la página 1de 166

Trace tables

Natalee A. Johnson, Contributor

Good day students. In today's lesson I will continue to look at trace tables and begin to look
at relational operators and truth tables.

Here is the solution to the practice questions you were given in the previous lesson.

1. Numcount <---- 0
Sum <-------------0
Largest <----------0
Read Number

While Number not equal to 0 do


Sum <---- Sum + Number
Numcount <------ Numcount + 1
If Number > Largest
Largest <------ Number

Endif

Read Number

Endwhile
Average <---- Sum/Numcount
Print Average, Largest

2. Input N
COUNT <---- 0
NONCOUNT <----0
ZEROCOUNT <-----0

Repeat
Input Number

if Number = 0 then
ZEROCOUNT <------- ZEROCOUNT + 1
end if

if Number not equal to 0 then


NONCOUNT <----- NONCOUNT + 1
endif

COUNT <---- COUNT + 1


Until COUNT <---- N
Print ZEROCOUNT, NONCOUNT

3. Oldage <------ 0
For j <---- 1 to 10 do
Read Name, Age
If Age > Oldage then
Oldage <---- Age
Oldperson <---- Name

Endif

Endfor
print "The oldest person is". Oldperson

Trace Tables

As indicated in the previous lesson your trace table is used to test and verify your algorithm.
Let us look at an example of how a trace table is executed using question 1 of the practice
question you were given in the previous lesson.

Example 1

Write a pseudocode algorithm to read a set of positive integers (terminated by 0) and print
their average as well as the largest of the set.

1. Numcount <---- 0
Sum <------------ 0
Largest < -------- 0
Read Number
While Number not equal to 0 do
Sum <----- Sum + Number
Numcount <----- Numcount + 1
If Number > Largest

Largest <------ Number


Endif

Read Number

Endwhile

Average <---- Sum/Numcount

Print Average, Largest

The Trace Table

Example 1

We will use the following numbers as inout for the trace table: 2,5,6,1,10 and 0.

Largest
Number Numcount Sum (Variables used for column
headings)
0 0 0
(Step 1: Initializing key
variables)
2
2 (Step 5:
1 = (0 + 1) 2 = (0 + 2)
(Step 2: . Compare Largest with
(Step 4: (Step 3: Sum
While number is not equal number.
Numcount <---- <--- Sum +
to 0. Read input value . Number with greater than
Numcount + 1) Number)
(Number 1) Largest. Largest is now equal
to Number)
5 2 = (1 + ) 7 = (2 + 5) 5
6 3 = (2 + 1) 13 = (7 + 6) 6
6
(Note Largest remains the
1 4 = (3 + 1) 14 = (13 + 1) same because Number which
is '1' is not larger than Largest
which is currently 6)
24 = (14 +
10 5 = (4 + 1) 10
10)
0
(When the user enters this
value the algorithm will stop
as this value terminates the
program)

Average <----Sum/Numcount

Largest <---- Number

Average <---- 24/5


Average <---- 4.8
Largest <----- 10

 For the exampleabove you will first initialize your variables as shown in the
algorithm.
 Then you would repeat step 2 to step 5 until the user enters '0'. The program
will then stop.

 The Average will be calculated (24/5), average is 4.8

 Both the Average and the Largest value will be printed which is 4.8 and 10
respectively.

NB: When you are repeating step 2 to step 5 until the condition is met (the program ends)
you must work with the current values stored in the respective variables.

RELATIONAL OPERATIONS & TRUTH TABLES

The Relational operators are used for comparison of the value of one element with another. There
are six types of relational operations: equal, greater than, less than, greater than or equal to,
less than or equal to, and not equal to. Each of these operations can be used to compare the
values of the variables. The result of each of these operators is either true or false. When using
these operators, make sure all the arguments are the same data type. Integers should be compared
with integers, strings with strings, and so on. Table 1 reviews each of these operators.

Table 1 Relational Operators


Operator
Symbol Description
Name
Equal = Returns true if both sides are equal.
Returns true if the variable on the left is greater
Greater than >
than the variable on the right.
Returns true if the variable on the left is less than
Less than <
the variable on the right.
Returns true if the variable on the left is greater
Greater than or equal to >= than or equal to the value of the variable on the
right.
Returns true if the variable on the left is less than
Less than or equal to <=
or equal to the value of the variable on the right.
Not equal to <> Returns true if both sides are not equal.

We have come to the end of lesson twenty three in our series of lessons in the CSEC
Information Technology lectures. See you next week where we will continue to look at
Relational Operators and Truth Tables. Remember if you fail to prepare, you prepare to fail.
Algorithms and flowcharts - Control Statements pt 3
Natalee A. Johnson, Contributor

Good day students. In today's lesson I will continue to look at algorithms and flow charts:
control statements and trace tables.

Loops

The Repeat - Until Loop

The Repeat - Until Loop syntax is shown below:

REPEAT

Block Statement(s)

UNTIL (condition)

or

REPEAT

Block Statement(s)

UNTIL <condition is true>

The Repeat - Until loop is similar to the 'while loop' except the condition is tested at the end
of the loop. Thus, the block of statement(s) will continue to execute as long as the specified
condition in the UNTIL statement is false. Using the same example of having a bowl of soup
with a spoon, you would continue to sip your soup as long as you have soup in your bowl.

Example 1

Repeat
__fill spoon with soup
__put spoon in mouth
__swallow soup
Until bowl is empty

[Block of instructions is carried out until statement is false]

Example 2

Sum <-- 0
N <----20

Repeat
Sum <-- Sum + N
N <-- N + 3

Until (Sum >60)

Print N, Sum

When constructing a solution to a programming question that contains a loop, ask yourself
the following questions:

 What type of loop do I need? Is it Definite or Indefinite?


 Does the question require any input? Yes or no? If the answer to the question is yes,
then for a 'for loop' your first input statement must take place somewhere
immediately following the beginning of the loop. If your loop is a 'while loop', then
you will have to use an input statement:

 before the beginning of the loop

 towards the end of the loop

 Do I need to count anything? If yes, how many? For each item to be counted you
need to initialise each counter variable before the start of the loop, and you need to
put each counter construct inside the loop?

 Do I need to sum or accumulate any value? Do I need a product, average, etc. If


yes, how many? For each value to be accumulated you need to initialise an
accumulator to 0 outside the loop and you need to place an accumulator construct
inside the loop.

 Is there any condition(s) specified by the questions? If yes, for each counter,
accumulator or print statement within the loop block, ask yourself under what
condition does it do this?

 Do I need to print anything? If yes, where do I put my print statement? Inside the
loop or outside the loop? A print statement placed inside a loop will be executed
(carried out) each time the loop block is repeated.

 What action must I perform when the loop terminates? You may need to calculate an
average, a difference or print a value.

PRACTICE QUESTIONS

1. Write a pseudocode algorithm to read a set of positive integers (terminated by 0) and


print their average as well as the largest of the set.

2. Write a pseudocode algorithm to read a positive integer N followed by N integers. For


these N integers, the algorithm must count and print the number of zero and non-zero
values.

3. Write an algorithm to read the names and ages of 10 people and print the name of the
oldest person.
Assume that there are no persons of the same age.
The prompt statement

This is the statement that we use to output a particular statement to the user in a given
pseudocode algorithm.

The syntax for writing such a statement is as follows:

Print "Statement"

Example 1

Print ("Enter two numbers") (The prompt statement (asking the user to enter two
numbers) )

Read Num1, Num 2

Difference <--- Num 1 - Num 2

Print Difference

Write an algorithm to read two numbers and calculate the difference of the two numbers.
The algorithm should prompt the user for the two numbers and output the difference.

TRACE TABLE

A trace table is an important tool for testing the logics of a pseudocode for correctness. A
trace table is a rectangle array of rows and columns. The column headings are the variables
in the pseudocode. As instructions in the pseudocode are carried out and the variables are
modified, the changes are recorded in the appropriate column in the table. When the
pseudocode terminates, the final values in the trace tables should reflect the correct result.

We have come to the end of the lesson. See you next week where we will continue to look
at trace tables. Remember, if you fail to prepare, prepare to fail.
Algorithms and flowcharts - Control Statements pt 2
Natalee A. Johnson, Contributor

Good day students. In today's lesson I will continue to look at algorithms and flow charts:
control statements.

Loops

Key things to note when working with loops:

The use of an accumulator

In our previous lesson, for the ' for loop' example we were required to find the sum of 10
numbers. You would agree that it would agree that it would be time consuming to sit and
memorise the 10 numbers entered in order to add them.

With the use of an accumulator you do not need to write down or try to memorise the
numbers. As in the case of the 'for loop', you can start sum with the value 0 and each
time you are given a new number you add it to your present sum. Hence the statement:
Sum <-- Sum + num, if the first number entered is 40, your sum would be 40. Therefore
Sum <--- Sum + num, would be Sum <--- 0 + 40 = 40

If you then add another number, say 10 to your present sum, your new sum would be 50.

Sum <--- Sum + new number

Sum <--- 40 (sum) + 10 (new number) = 50

The process will continue until all the numbers have been totaled. The only value you will
keep in your memory is the current sum.

Counters

This is th eprocess of counting the number of times a value is entered or a statement is


carried out. You can also allow your counter to begin at 0 and then increment (increase
accordingly). Here is an example of an assignment statement with use of a counter.

Counter <--- 0
Counter <---- Counter + 1

In the example abovem, counter is initially set at 0, which means that every time the
assignment statement is executed, the value of the counter variable is increased by 1. Thus
the assignment statement will provide a mechanism for counting. Using the same for loop
example, a counter would count and keep track of the 10 numbers which would be entered
and then totaled. Such that only 10 numbers will be entered.

Please note you could start your counter at 2, 5 and so on, depending on the
algorithm.
The While Loop

The While Loop syntax is shown below:

While Variable not equal to Control_Variable Do

Block Statement(s)
Endwhile

The 'While' loop is an example of an indefinite loop; it facilitates the repetition of a block
of instructions until a certain condition is met. No one knows exactly how may times the
block statements (instructions) will be carried out. Using the same example of having a
bowl of soup with a spoon, no one can tell how many sips you would take that will fill your
stomach. It depends on the size of your stomach and the size of the spoon. The algorithm
would look something like this:

Example 1

Please note you use the WHILE LOOP when you do not know exactly ho many
times a block of statements will be carried out. In this case there will be some
terminating condition.

Example 2

Write a pseudocode algorithm to read a set of integer numbers terminated by 999. The
pseudocode should find the sum and average of th enumbers. The algorithm should also
output the sum and avergae of the numbers

Pseudocode version

Algorithm sum and average

This program will read a set of integer numbers and calculate the sum and average of the
numbers.

Sum <-- 0
Counter <-- 0
Read number
While number <> 999 do
Endwhile
Average <--- Sum/Counter
Print "The sum is", Sum
Print "The Average is", Average

We have come to the end of another lesson. See you next week where we'll continue to look
at control statements: Loop Structures. Remember, if you fail to prepare, be prepared to
fail.
Algorithms and flowcharts - Control Statements
Natalee A. Johnson, Contributor

Good day students. In today's lesson I will continue to look at algorithms and flow charts:
control statements.

Loop (repetition)

Most of the things we do in our everyday lives require some form of repetition, like getting
ready for school or work. You perform the same steps over and over five to seven days per
week.

When we want the computer to repeat some statements several times, we need a loop
structure or a loop in the pseudocode to instruct the computer what to repeat and how often
these steps are to be repeated.

Every loop has four major elements. These are:

 Initialisation
 Repetitive statement(s)

 Loop statements (block)

 Conclusion

Initialisation

Before a loop is started, we may need some statements to get started. For example, we
may need to initialise a variable to a start value or read an initial value into a variable.

Repetitive statements

These are the statements that the computer will repeat.

Loop block

We must specify what statements are to be repeated by the computer. The repetitive
statements are normally placed in the loop block.

There are namely three main types of loop constructs and they are: For Loop, While Loop
and Repeat Until. Let us now examine each of these loop constructs.

The FOR loop

The For Loop syntax is shown below:

For Control_Variable = 1 to N Do
Block Statement(s)

Endfor

The "FOR" loop is an example of a definite loop, it facilitates the repetition of a block of
instructions a definite number of times. Let us look at an example of having a bowl of soup
with a spoon; you could have at least 20 sips of the soup. The algorithm would look
something like this:

Example 1

Please note you use the FOR LOOP when you have a block of statements that will be carried
out a set number of times, otherwise you use a different loop construct.

Example 2

Pseudocode version

Algorithim Sum

This program will read 10 numbers and find the sum of those numbers.

Sum ---- 0

For counter ----- 1 to 10 do

Read number
Sum ----- Sum + number

Endfor
Print "The sum is", Sum

Flow chart version


Write an algorithm to read ten numbers and output the sum of the numbers.

We have come to the end of another lesson. See you next week where we'll continue to look
at Control Statements: Loop Structures. Remember, if you fail to prepare, be prepared to
fail.
System and Applicaton Software (pt 2)
Natalee A. Johnson, Contributor

Good day students. In today's lesson, I will conclude looking at


system and application software and begin to look at problem-
solving and programme design.

USER INTERFACES

Graphical user interface

A graphical user interface (GUI, commonly pronounced 'guey') is


a human computer interface (HCI) based upon a graphical
display. GUIs are most commonly found on workstations or PCs
fitted with graphics adapters able to support high-resolution
graphics. GUI is a variation of the menu-driven system of
selecting commands with the use of the mouse. This system,
popularised by the Apple Macintosh, uses a graphical user
interface. This consists of icons and 'pop-up' and 'drop-down' menus. A mouse is used to
click on an icon to execute some operation or select options from a pop-up or drop-down
menu.

Advantages of GUIs

 Its user-friendliness results in less anxiety on the part of the user


 Icons/symbols are easier to recognise and provide the user with a context

 Fewer command errors

 Reduced typing

Disadvantages of GUIs

 It may consume more screen space


 For programmers, the design of GUI is more complex

 Clicking an icon can produce unexpected results because of a lack of icon standard

 Increase use of computer memory can lead to slower processing

PRACTICE QUESTIONS

Past paper 2006

Question 5

Your teacher has given you notes on Windows NT, Windows 2000, UNIX and LINUX.

(a) State the type of system software illustrated in the above examples.
(b) Explain why this software is necessary for a computer system.

(c) For EACH of the following types of application software, state whether it can be
described as general purpose, custom-written, integrated or specialised.

(i) A programme that includes all the major types of applications and brings them together
into a single software package.

(ii) Software written solely for a specific task and its users are trained in a particular field.

(iii) Software which can be modified by writing or adding programming modules to perform
specific tasks.

(iv) Software which is not specific to any organisation or business and can be used by
anyone.

Question 6

Name the TWO types of user interface which are represented in the figures below.

C > dir

Figure 1 Figure 2

(a) Discuss which user interface would be better for someone who is not familiar with a
computer.

(b) State the name of another user interface not mentioned in (b).

Problem-solving and program design

We are now officially starting a new unit in the syllabus. With this unit, your problem-
solving skills and ability to write simple programs will be tested. So, the question is: do you
like to solve problems? If you do, then you should do well with this unit. If you are not the
problem-solving type, we will work together, nonetheless, to have you develop the skill of
doing so.

Let us begin. In our everyday life we actually solve simple problems. For example, you have
a problem getting to school early in the morning. How would you solve this problem?

 First, you need to examine the problem.


 Determine possible solutions to the problem, such as setting an alarm, making
arrangements with a taxi to pick you up early, travelling with a friend who is
normally early for school or getting ready for school on time.

 You would then evaluate the possible solutions to determine the best solution to the
problem.
 Choose the best solution to your problem.

Similarly, the computer is designed to solve problems for you, the user. How is this
possible? A computer solves end-user problems by following a set of instructions given to it
by the programmer and produces the specified results. The computer programmer creates
the instructions for the computer to follow. These instructions are referred to as computer
programs. You were introduced to the term computer programs when we looked at
software. A computer program is a finite set of clear and specific instructions written in a
programming language.

Problem-solving on the computer

The design of any computer program involves two major phases:

 The problem-solving phase


 The implementation phase

The problem-solving phase consists of the following steps:

1) Define the problem

2) Find a solution to the problem

3) Evaluate alternative solutions

4) Represent the most efficient solution as an algorithm (you will learn about this in
upcoming lessons)

5) Test the algorithm for correctness

The implementation phase consists of the following steps:

1) Translate the algorithm into a specific programming language

2) Execute the program on the computer

3) Maintain the program.

We have come to the end of lesson 16 in our series of lessons. See you next week when we
will continue to look at problem-solving and program design. Remember, if you fail to
prepare, prepare to fail.
System and Applicaton Software
Natalee A. Johnson, Contributor

Good day, students. This is lesson 15 of our series of Gleaner information technology
lessons. Today, we will continue to look at system and application software.

We will continue to look at the choice of O/S, which is dependent on the processing
environment required by the user. The first environment we looked at last week was batch
processing. Let us look at the others:

Time-sharing multi-processing

The processor's time is divided into small units called time slices and shared, in turn,
between users to provide multi-access. These systems allow the CPU to switch between
different programmes rapidly, so that users are unaware that they were 'time-sharing' the
CPU with others. Several persons can connect to the main computer via dumb terminals and
access different application programmes.

Single-user processing system

These systems came on the scene with the advent of personal computers. The majority of
small micro-computer-based systems have operating systems, which allow a user to
operate the machine in an interactive conversational mode (response to the user's message
is immediate), but normally only one user programme can be in main storage and
processed at a time. There is no multiprogramming of user programmes. Multiprogramming
occurs when more than one programme in main storage is being processed, apparently at
the same time. This is accomplished by the programmes taking turns at short bursts of
processing time.

Single-user multi-tasking

This system only allows one person to use the computer at a time to do multiple tasks.

Real time processing

This is a system that is able to process data so quickly that the results are available to
influence the activity currently taking place. There is often a need for multi-processing.
Multi-processing is the name for the situation that occurs if two or more processors are
present in a computer system and are sharing some, or all, of the same memory. In such
cases, two programmes may be processed at the same instant. These systems are used
mainly in critical systems. Critical systems are systems where delay in the processing of
data after its input can lead to the destruction of life and property. Examples of critical
systems are systems that monitor critically ill patients, nuclear plants, the engine of an
aeroplane, etc.

Utility software
Utility programmes perform tasks related to the maintenance of your computer's health,
hardware or data. Some are included with the operating system; others can be bought as a
separate package. Utility programmes perform tasks such as:

 File management
 Disk management

 Back-up

 Data recovery

 Data compression

 Antivirus programmes

USER INTERFACES

The interaction between end users and the computer is said to take place at the human
computer interface (HCI). The term 'human computer interface' is meant to cover all
aspects of this interaction, not just the hardware. One of the most important features
normally required in an HCI is that it be user- friendly. As the name suggests, a user-
friendly interface is one that the end user finds helpful, easy to learn about and easy to use.
It is easy to recognise unfriendly interfaces, but not so easy to design one that is certain to
be user-friendly.

Types of interfaces

There are many different types of user interfaces available. They may be broadly classified
as follows:

 Command-driven interfaces
 Menu-driven interfaces

 Direct manipulation interfaces

 User interface management system (UIMS)

 Special purpose interfaces

 Graphical user interface

Note: In some situations, two different types of interfaces may be combined, for
example, a menu interface with command options.

Command-driven interfaces

One of the long-established methods by which users can interact with the computer is
utilising commands. Commands enable the user to quickly and simply instruct the computer
what to do. However, they require the user to already have knowledge of what commands
are available, what they do and the rules governing how they should be typed, so they are
more suited to experienced users than the end user. A technical person, such as a computer
operator or programmer, would be familiar with the commands, or where the end user
continually works with the same programme and, therefore, can gain mastery of the
commands.

Advantages of command-driven interface

 Faster to use, once you have learnt the commands.


 For a computer programmer, command-driven interfaces are cheaper to implement.

Disadvantages of command-driven interface

It is sometimes difficult to remember all the commands. Therefore, users have to constantly
refer to the software user manual.

The user is restricted to using only the keyboard as the interfacing device, while with other
interfaces, a wide variety of input devices can be used.

Commands must be entered at a special location on the screen and in a set format.

Menu-driven interfaces

Menus provide another popular form of user interface. There are many different alternative
forms of menus. The simplest menus provide the user with a number of options and a
simple means of selecting between them. The user is presented with a choice and,
therefore, does not have to remember any commands. The interface is, therefore, suitable
for beginners and infrequent users. All the user has to do is to make a choice. A special type
of menu, called a pop-up menu, an additional sub-menu, pops up as a selection is made.
You can click anywhere on a given document using the right-click mouse button to allow a
pop-up menu to appear.

Pull-down menus are a special type of menu used in windowing and were briefly
introduced. It is a menu displayed as a vertical list which hangs from a horizontal bar on the
screen in order to elicit a choice from the user.

Advantages of menu-driven interfaces

 The user is presented with a list of options to choose from, they do not need to
remember the commands.
 Free from typing errors, because the user does not have to type the commands

 A wide variety of input devices can be used to interface with a menu

Disadvantages of menu-driven interface

 Several steps required to issue a command.


 Once the user has learned the menu system, it is bothersome to have to wait on the
package to present the questions before the commands can be entered.

We have come to the end of Lesson 15 in our series of CSEC information technology
lectures. See you next week when we will conclude looking at user interfaces and the topic
'system and application software'. Remember, if you fail to prepare, you prepare to fail.
Application and system software (pt 2)
Natalee A. Johnson, Contributor

Good day students. In today's lesson, I will continue to look at system and application
software.

SYSTEM SOFTWARE

Many systems are supplied by the computer manufacturer since, to write them, a
programmer needs in-depth knowledge of the hardware details of the specific computer. On
the other hand, many applications can be written with very little knowledge of the hardware
details of a specific computer, and can run on several different computers, with little or no
modifications.

The most important systems programme is the 'operating system'. This actually consists of
a number of designs to ensure the smooth running of the computer system. Other common
system programmes (from the user's viewpoint) are:

1) The editor - this programme enables users to create files for storing their programmes
and data. It also provides facilities for making changes (such as adding or deleting lines) to
files.

2) Language translators - people normally write programmes in what are called high level
languages (such as Basic, Pascal, Fortran or Cobol). Before the computer can run these
programmes, they have to be translated into the binary codes known as the machine
language. Each language needs its own translator. Language translators can be divided into
three broad classes: compilers, interpreters and assemblers.

3) Diagnostic programmes - these provide facilities which help users to debug (remove
errors from) their programmes more easily.

4) Utility programmes - on a typical computer system, there are many routine functions
and operations which users may wish to perform. Utility programmess are usually provided
to perform these functions and operations. One of the most common of these is the sorting
of data into desired sequence.

OPERATING SYSTEM

An operating system may be seen as a suite of programmes that has taken many functions
once performed by human operators. The sophistication and speeds of modern computers is
beyond the capability of human operators to control without the aid of an operating system.
The role of the operating system is, therefore, one of resource management. The primary
resources it manages are:

 Processors
 Storage

 I/O devices
 Data

 Programmes

It is quite evident that the operating system controls the way software uses hardware. This
control ensures that the computer not only operates in the way it's intended by the user, but that it
does so in a systematic, reliable and efficient manner. This 'view' of the operating system is
shown :

Part of the operating system remains in main storage permanently during the running of the
computer. This part is called the Kernel (or Supervisor or Executive) and, as the name
suggests, it is the controlling part of the operating system. It controls the running of all
other programmes. The remainder of the operating system programmes is stored on a
direct access storage device from which any particular one will be 'called' into main storage
by the kernel when required.

On many, very small microcomputers, the kernel is stored permanently in ROM and starts
execution the moment the computer is switched on. A message is usually displayed by the
kernel to signify it is ready to accept commands from the user. On most modern computers,
the kernel is not in main storage when the machine is switched on. The system must be
'booted up'. This sometimes involves pressing special 'boot buttons', keys or switches,
which cause the hardware to load the kernel into main storage from a predetermined
position on a disk.

Functions of the operating system

 In multitasking, where multiple programmes can be running at the same time, the
operating system determines which application should run, in what order, and how
much time should be allocated for each application before giving another application
a turn.
 It manages the sharing of internal memory among multiple applications.

 It handles input and output to and from attached hardware devices such as hard
disks, printers and dial-up ports.

 It sends messages to the applications or interactive users (or to a system operator)


about the status of operations and any errors that may have occurred.
 It can offload the management of what are called batch jobs (for example, printing)
so that the initiating application is freed from this work.

 On computers that can provide parallel processing, an operating system can decide
how to divide a programme so that it runs on more than one processor at a time.

Choice of operating system

The applications for which a computer is needed largely determine the choice of hardware
and accompanying software. The operating system supplier will need to consider these
factors:

 The hardware provision and basic design of the computer


 The applications intended for the computer

 The method of communication with the computer, for example, many or few
peripherals

 The method of operating the computer

Examples of operating systems include: Windows 1.5 to Windows 2007, UNIX, LINUX, DOS,
MAC OS, and so on.

The choice of O/S is also dependent on the processing environment required by the user.
This includes:

 Batch processing
 Time sharing multi-processing

 Single User Processing system

 Real time online processing

 Single-user multitasking processing

Batch systems

These are systems that provide multi-programming of batch programmes but have few
facilities for interaction or multi-access. Commands, or jobs, are collected in groups and
processed in the order in which they are placed; that is, in a 'first in, first out' sequence.
Each group of commands or jobs is called a batch. The jobs are entered in a batch queue
and then run one or more at a time, under the control of the operating system. A job may
wait in a batch queue for minutes or hours, depending on the workload. No amendments
are possible during processing.

We have come to the end of lesson 14. See you next week when will conclude looking at
operating systems and begin to look at user interfaces. Remember, if you fail to prepare,
prepare to fail.
Binary representation
Natalee A. Johnson, Contributor

Good day students. In today's lesson, I will begin to look at binary representation and
manipulation. How are you with figures? This week's lesson, and other lessons to come, will
require you to do some calculations.

Computers store and manipulate data numerically, using the binary system (referred to as
the machine language) which is comprised of '1' or '0' and, of course, we will be working
with base 2 in our calculations.

Converting decimal numbers to their binary equivalent

To convert decimal numbers to binary you are simply going to be dividing the number by 2
and subsequently making a note of the remainder. You will stop dividing when you arrive at
zero. The binary answer is written from the bottom up. Let us now look at an example.

Example 1

Converting binary numbers to their decimal equivalent

When converting binary numbers to decimal, for each of the binary digits (bit) you are going
to have base 2 raised from 0 to the corresponding number of bits you have. So, if you have
four bits, then base 2 will be raised from 0 to 3, for example, 20 - 23. Then the value you
get when two is raised to the corresponding number is multiplied by its corresponding bit,
starting from right to left. You then add the corresponding decimal numbers together to get
the decimal equivalent of 10112. Let us now look at an example.

Example 2

I am going to use the answer we obtained from example one.


Convert 10112 to its decimal equivalent (This way you can tell if the answer we obtained in
example one is correct).

Binary Addition

When adding numbers in binary, there are five rules you should apply:

0+0=0

0+1=1

1+0=1

1 + 1 = 10 (This is the binary equivalent of 2, which is read as 'one zero' and not 10)

1 + 1 + 1 = 11(This is the binary equivalent of 3, which is read as 'one one' and not 11)

Example 3

Subtracting in binary

When subtracting numbers in binary, there are four rules you should apply:
Please ensure that you include base 2 in your answers as shown above.

PRACTICE QUESTIONS

1. For questions a and b, convert the decimal numbers to binary and for c and d, convert
the binary digits to decimal numbers.

(a) 90

(b) 25

(c) 1010002

(d) 110002

2. Add the following numbers:

(a) 01012 and 00112

(b) 01112 and 00102

3. Subtract the following numbers:

(a) 111012 - 00112

(b) 011012 - 00102

We have come to the end of lesson eight in our series of lessons. See you next week when
we will continue to look at binary representation and manipulation. Remember, if you fail to
prepare, you prepare to fail.
For future use
Natalee A. Johnson, Contributor

Good day students. This is lesson three of our series of lessons. Today we will be looking at
secondary storage media.

Secondary storage media

Secondary storage media became necessary out of the fact that primary storage devices
such as RAM and ROM are limited in size and are temporary or volatile, while secondary
storage is permanent and can be used for backup purposes and future use. A comparison
can be made among the variety of secondary storage devices in respect to their portability,
speed and capacity.

Let us look at each of these key factors.

Storage capacity - This is referring to the amount of information that a particular storage
medium can hold. Large capacity storage devices are more appreciated and preferred for
many sophisticated programmes and large databases.

Access speed - This refers to the average time needed to locate data on a secondary
storage device. Access time is measured in milliseconds.

Portability - This refers to the ease and accessibility of a device to transfer information
from one computer to another.

Every secondary storage device or medium requires its own drive. Media (singular:
medium) are the physical hardware on which a computer keeps data, instructions and
information for future use. Examples are diskettes, hard disk, compact disc and tapes.
Storage devices record and retrieve data, instructions and information to and from storage
media. Examples are floppy disk drive, Hard disk drive, compact disc drive.

Secondary storage devices fall into two main categories:

 Direct access storage devices (DASD)


 Serial/sequential access storage devices (SASD)

Direct access storage - This is where any data can be accessed without reading any other
data items first (randomly). Examples: floppy diskette, flash drive, hard disk drive, etc.

Serial access storage - This is where all data between the read/write head and the
required data have to be passed over before the data can be accessed.

Read/write head - A device that reads data from and writes data on to a storage media.

Types of storage media

 Floppy diskettes
 Hard disks

 Magnetic tape

 USB flash drive

 CD-ROM (Compact Disc Read Only Memory)

 WORM (Write Once Read Many)

 Compact Disc Recordable (CD-R)

 Compact Disc Rewritable (CD-RW)

 Digital Versatile/Video Disc (DVD)

 Flash memory

Floppy disk

This is a removable disk that has a small storage capacity; it is typically used to store
documents so it can be used on more than one computer. Diskettes are normally used to
store backup copies of important information (in case original copy becomes damaged or
lost) and to transfer information from one computer to another. Diskettes are available in
two sizes: 5 and 3 .

Hard disks/hard drive

This is normally permanently installed and fixed into the computer. However, there are
external hard drives available. A hard drive can access data much more quickly than floppy
disk drive; most importantly, it can store much more data.

Magnetic tape

A magnetic tape is a tape coated with a magnetic material on which data can be stored. This
is a sequential access storage device that is usually used for backup purposes. Types of
magnetic tapes include cassette, cartridge and reel.

USB flash drive

A USB flash drive is a very small, portable flash memory that plugs into a computer USB
port and functions as a portable hard drive. USB flash drives are easy to use as they are
small enough to be carried in a pocket and plug into any computer with a USB drive.

CD-ROM

CD-ROM is an optical disc capable of storing large amounts of data (up to 1 GB). The CD-
ROM has replaced the floppy disk as the media for software distribution, as it has the
storage capacity to hold as much data as 700 floppy disks. Data on this medium can be
read but, unlike magnetic disks and tapes, they cannot be changed (read only).

WORM
WORM discs are non-erasable discs that can offer up to 20GB of storage capacity on a single
disc. While WORM discs are very portable, their inability to erase data written to the disc
makes this removable storage a favourite for archival purposes, that is, for storage of
historical information.

CD-R and CD-RW

Compact Disc Recordable and Compact Disc Rewritable are types of CDs that allow data to
be written to (stored on) discs. CD-R drives allow users to record information to a CD,
providing an easy way to archive data or share files. CD-RW discs allow you to write data to
the CD multiple times.

DVD

A DVD is a type of optical disc technology similar to the CD-ROM. A DVD holds a minimum
of 4.7 GB of data, enough for a full-length movie. It is commonly used as a medium for
digital representation of movies and other multi-media presentations that combine sound
with graphics. It is becoming increasingly popular, as it can store much more data than CD-
ROMs; up to 17 GB of data.

FLASH MEMORY

Flash memory is a non-volatile computer memory that can be electrically erased and
reprogrammed. It is a technology that is primarily used in memory cards and USB flash
drives for general storage and transfer of data.

To review last week and this week's lesson, complete this past paper question:

1.(a) Give ONE similarity and ONE difference between EACH of the following pairs:

(i) ROM and RAM

(ii) ROM and EPROM

(iii) EPROM and EEPROM

(iv) Hard disk and floppy disk

(v) Primary and secondary storage

We have come to the end of our third lesson. See you next week and remember, if you fail
to prepare, prepare to fail.
It's time for memory storage
Natalee A. Johnson, Contributor

Good day students. In today's lesson we will be looking


at memory storage media and unit of storage.

MEMORY STORAGE

The purpose of memory is to provide storage for data,


instruction and the result of processing. There are four
main categories of memory storage chips:

¯Random Access Memory (RAM)

¯ Read Only Memory (ROM)

¯ Cache

¯ Buffer

A memory chip is one that holds programmes and data either temporarily or permanently.
Let us now look at each of these categories.

RAM

RAM or primary storage is the chip located next to the CPU and is referred to as being
volatile. It is considered so because its content is erased whenever the flow of electricity to
the processor is terminated. This is why your teacher will often remind you to save your
work frequently. RAM performs three main functions:

¯ Stores data for processing

¯ Stores instructions for processing the data

¯ Stores processed data (information) that is waiting to be sent to an output or


secondary storage device.

ROM

A ROM chip stores data permanently or is often times referred to as being non-volatile. The
information on a ROM chip is stored on it by the manufacturers and cannot be modified or
erased by the user. The processor can read and retrieve the instructions and data from the
ROM chip, but its content cannot be changed. Whenever you turn on your computer and it is
booting up, messages are made possible by the information in ROM.

There are several variations to ROM:

Programmable Read-Only Memory (PROM)


The PROM chip is left blank by the manufacturers and written to by the customer. Once
written to the chip, it becomes read-only memory.

Erasable Programmable Read-Only Memory (EPROM)

EPROM is a reusable PROM-chip that can be erased by a special ultraviolet light. EPROM
holds its content until erased and new instructions can be written on it. To reprogramme an
EPROM chip it has to be removed from the computer.

Electrically Erasable Programmable Read-Only Memory (EEPROM)

The EEPROM chip is similar to an EPROM chip except that it is erased by applying electrical
pulses to the chip, making it possible to reprogramme the chip without removing it from the
computer.

CACHE MEMORY

Cache memory is a special high-speed memory designed to supply the processor with the
most frequently requested instructions and data. Instructions and data located in cache
memory can be accessed many times faster than instructions and data located in main
memory. The more instructions and data the processor can access directly from cache
memory, the faster the computer runs as a whole.

BUFFERS

A buffer is an internal memory area used for temporary storage of data records during input
or output operations. For example, most modern printers are equipped with buffers that
store information or data to be printed.

UNIT OF STORAGE

Terms associated with storage of data

Bit - a unit of storage that has two possible values 0 and 1. It is the smallest unit.

Byte - a group of eight bits.

Word - the size of the data (or instruction) that the CPU can handle in a single cycle.

Word length/word size - the number of bits in a word.

Address - the identification of a particular location in the memory where a data item or an
instruction is stored.

Address content - the data or instruction that is stored in a given address.

Bistable device - a device that can exist in one of two possible states. It can be compared to an
on/off switch
Total - 8 mark
The computer system
Natalee A. Johnson, Contributor

Good day, students. Welcome to a new school year. I trust you had a restful summer for the
work that lies ahead.

Remember that your examination in 2010 will be based on the new syllabus and there will
be no practical examination for Paper 02. It is also imperative at this time that you
complete your school-based assessment (SBA), which is now 30 per cent of your final
grade. The SBA components are: Word Processing, Spreadsheet, Database Management
and Problem Solving and Programming.

This is lesson one of our series. Today, we will be looking at the computer system.

The computer system

A computer may be defined as an electronic device which accepts input, processes the input
and produces results (output) from the processing and store data and results for future use.
Even though we tend to use the words data and information interchangeably, there is a
difference between the two. Data is a set of raw facts and figures while information is
processed data.

The main components of a computer system are hardware, software and the user.

 Hardware - This is the name given to the physical parts of a computer that you can
see and touch. There are five general categories:
 Input devices - They get data into a computer. A mouse, keyboard and a scanner
are all input devices.

 Central processing unit (CPU) - This is the brain of a computer and controls how
the rest of the computer works. It is assisted by the control unit (CU) and the
arithmetic logic unit (ALU). The CU carries out instructions in the software and
directs the flow of data through the computer; the ALU performs the calculations and
logic operations.

 Output devices - They get processed information out of a computer, for example,
to a printer, monitor or even speakers.

 Storage devices - Include floppy drives, hard disk drives, flash drives, CD ROM
drives, and so on, that are used for storing information permanently.

 Memory - Enables a computer to temporarily store instructions and data.

The data processing cycle

 Software - This is the name given to the computer programmes that tell the
hardware how to work. Without software the computer hardware would do nothing
as there would be no instructions.
 Computer programmes - These are instructions (programmes) produced by
programmers to create system and application software.

 System software - This software is usually called an operating system since it


controls the hardware and how all the other software work. The most commonly
used operating system is Windows made by Microsoft Corporation.

 Application software - This software instructs a computer to carry out or perform a


specific task. Word Processors, Spreadsheet and databases are all application
software.

We have come to the end of our first lesson in our series of information technology lectures.
See you next week. Remember, if you fail to prepare, you prepare to fail.
Answers for last week's past-paper questions
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be looking at the answers to last weeks past-
paper questions for the theory examination. The example used for the purposes of this and
the previous lesson was the May 2008 theory exam.

Answers

1. a. 1) The black-ink cartridge was installed incorrectly. 2) The ink level is low in the black-
ink cartridge.

b. Soft copy is an electronic (monitor or storage device) version of a document while


hardcopy is the printed version.

2. General purpose application packages are designed to cover a single, but broad
application scope, while a specialised application package gives the user different tools for a
narrow application scope.

3. a. Electronic eavesdropping refers to the use of electro- nic devices to monitor electronic
communications between two or more communicating parties without permission from any
of those involved.

b. ONE physical access restriction that would help to ensure that ONLY authorised members
in a department have access to important computer equipment is fingerprint recognition to
gain access to the room.

c. ONE security measure that would ensure that ONLY authorised members in a department
have access to a document is password.

d. A sharing restriction can be used when one person is accessing a document that can be
accessed by others because this would prevent duplicates of the document as well as the
document containing outdated or incorrect information.

4. Consider the use of teleconferencing and telemarketing in a business.

a. One similarity between the two is that they both require the use of the telephone/
modem to be completed.

b. Teleconferencing refers to the use of the computer, Webcam and modem to communicate
by way of a conference with more than one person located in different places while
telemarketing is the use of the telephone to sell goods and services.

c. Telecommuting refers to employees working from home saving on transportation costs.

5. Consider the following URL:

http://www.youthalive.org/index.html
a. www.youthalive.org would be considered the website.

b. The Webpage would be index.html

c. The abbreviation html represents hypertext mark-up language.

d. http means hypertext transfer protocol.

e. A URL (uniform resource locator) is the address of a Webpage on the World Wide Web.

f. www.risingsun.org

6. A consultant has encouraged the administration of the bank where you work to install an
MICR system.

a. MICR means magnetic ink character recognition

b. MICR can be used to create special characters on checks for security purposes.

c. Before agreeing to install the MICR system, the systems analyst and the network
manager must determine:

 The benefits this new feature will bring to the bank.


 The locations of servers and other devices to support the MICR.

Explain which of the above tasks would be assigned to:

i. the systems analyst - benefits of the new feature to the bank.

ii. The network manager - locations of servers and other devices to support the MICR.

(Refer to your previous lessons if you are not confident in answering the following
question.)

7. Use the fragment of code below to answer parts (a) to (c).

Line 1 A = 3

Line 2 B = 5

Line 3 Sum = 1

Line 4 While B<= 10

Line 5

Line 6 ... B = B + A

Line 7 ... Sum = Sum + B


Line 8 End while

Line 9 PRINT Sum

a. For each of the following identify ONE line which contains:

i. An assignment statement - Lines 1, 2, 3, 6 or 7

ii. A loop - Line 4

iii. An output statement - Line 9

b. Copy and complete the trace table below.

A B Sum
3 5 1
3 8 9
3 11 20

c. State the result of the algorithm - the result of the algorithm is 20.

8. State what each of the following operators mean:

a. >= - greater than or equal to

b. = - equal to

c. < - less than

d. < > - not equal to

e. <= - less than or equal to

f. > - greater than

We have come to the end of another interesting lesson. See you next week where we will
complete this year's lessons with some general examination tips. Remember, work not hard,
but very smart.
Theory past papers
Nadine S. Simms, Contributor

Good day, students. In today's lesson we will be looking at some past paper questions for
the theory examination. This accounts for 30 per cent of your final grade.

Past Paper Questions - Theory Paper

The example that will be used for the purposes of this lesson is the May 2008 theory exam.

Instructions

1. The paper has four sections and all sections are to be completed.

2. Technical Proficiency - One, Two and Three

3. General Proficiency - One, Two and Four

Questions

1.

a. Give two reasons why a colour inkjet printer may print colour, but not black.

b. Explain the terms hardcopy and softcopy.

2. Explain how a general purpose application package is different from a specialised


application package.

3.

a. Explain the term 'electronic eavesdropping'.

b. Identify ONE physical access restriction that would help to ensure that ONLY authorised
members in a department have access to important computer equipment.

c. Identify ONE security measure that would ensure that ONLY authorised members in a
department have access to a document.

d. Explain why a sharing restriction can be used when one person is accessing a document
that can be accessed by others as well.

4. Consider the use of teleconferencing and telemarketing in a business.

a. State ONE similarity between the two.

b. State ONE difference between the two.


c. Explain how telecommuting is different from both teleconferencing and telemarketing.

5. Consider the following URL:

http://www.youthalive.org/index.html

a. What part of this address would be considered the website?

b. What part of the address would be the webpage?

c. What does the abbreviation 'html' represent?

d. What is meant by 'http'?

e. What is a 'URL'?

f. Create a URL for a company called Rising Sun.

6. A consultant has encouraged the administration of the bank where you work to install a
MICR system.

a. What does the term 'MICR' mean?

b. State ONE function of an MICR system that would be useful to a bank.

c. Before agreeing to install the MICR system the systems analyst and the network manager
must determine:

The benefits this new feature will bring to the bank and

The locations of servers and other devices to support the MICR.

Explain which of the above tasks would be assigned to:

i. The systems analyst

ii. The network manager

(Refer to your previous lessons if you are not confident in answering following question)

7. Use the fragment of code below to answer parts (a) to (c).

Line 1 A = 3

Line 2 B = 5

Line 3 Sum = 1

Line 4 While B<= 10


Line 5

Line 6 B = B + A

Line 7 Sum = Sum + B

Line 8 End while

Line 9 PRINT Sum

a. For each of the following identify ONE line which contains:

i. An assignment statement

ii. A loop

iii. An output statement

b.Copy and complete the trace table below.

A B Sum
3 5 1

c. State the result of the algorithm.

8. State what each of the following operators mean:

a. >=

b. =

c. <

d. < >

e. <=

f. >

We have come to the end of another lesson. See you next week when we will review the
answers. Remember to work not hard, but very smart.
Layout of a practical paper
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be looking at the layout of a practical paper
and how to approach it. The practical examination is worth 50 per cent of your final grade.
It is, therefore, very important that you get the highest grade possible on this paper.

Practical examination

The example that will be used for the purposes of this lesson is the June 2007 practical
exam.

Instructions

1. The time allotted for the examination is two hours as well as extra time for printing.

2. There are three questions on the examination with subsequent sub-questions: one for
word processing, spreadsheet and the other for database management.

3. It is advised to perform the instructions in the order given. Failure to do so may result in
the incorrect information being presented for grading. This can vary on what the question
requires of you.

Question 1 - Spreadsheet (refer to the previous lessons on spreadsheet tips)

In this question the following is asked of you:

(a) Open the file presented to you on your diskette.

(b) Add rows to the spreadsheet.

(c) Add columns to the spreadsheet.

(d) Insert title Rows in the first two cells of the spreadsheet.

(e) Formula to compute total number of an item across a row.

(f) Formula to compute total number of an item down a column.

(g) Format the headings of numeric columns to be justified as requested (right, left or
centre).

(h) Format numeric data to comma style or otherwise.

(i) Italicise the content of certain cells, in this case the names of countries.
(j) Format fonts in the spreadsheet based on size, boldness, justify as requested (right, left
or centre), merge and centre across the columns used by the spreadsheet.

(k) Insert a footer with your candidate number. This will have to be done in the page set-up
area of the spreadsheet, refer to the previous lessons on spreadsheet tips.

(l) Insert a new row with text specified.

(m) Insert a formula to computer percentage based on the layout given. (It is practical to
use cell referencing when creating formulas, refer to previous lessons on spreadsheet tips.)

(n) Insert a function to display the date. You can then format the cell to what was specified
in the question.

(o) Sort the spreadsheet in either ascending or descending order. This option can be found
in the toolbar at the top of the page.

(p) Filter data based on a specific criteria and save elsewhere in the spreadsheet.

(q) Create a chart based on certain information given. Remember, to select more than once,
hold down the CTRL key and use your mouse to select multiple cells.

Question 2 - Database management (refer to the previous lessons on database


management tips)

In this question the following is asked of you:

(a) Retrieve the database from your diskette.

(b) Insert a new field in a specified table.

(c) Create a form based on a specified table so that all the information for the table may be
entered through the form. (Refer to previous lesson on database management tips.)

(d) Using the form created in (c) above, enter the information given.

(e) Make changes to a specific field in a named table.

(f) Delete a record from a table.

(g) Sort the records in a table by either ascending or descending order.

(h) Perform a query to increase a specified field for each record by five. (This is an action
query, the update query. To prevent mistakes, you should first make a copy of the table
and then perform the update. If the update is correct, you may delete your copy of the
table and work with the newly updated one.)

(i) Use a query to find the following:

i. Total number of something


ii. Maximum of something

(In these, one would ensure the totals area in the design view of your query is present so
that the total and maximum can be used as criteria).

(j) Create a calculated field based on information given.

A calculated field takes information from one or more other fields and performs
mathematical operations to provide new information. It is written in this format:

Commission: [Sale Amount]*.1

Commission represents the name you are giving to the field. Sale amount is the name of a
field already in the database and must be in square brackets. Other examples include:

Commission: if([Sale Amount]<500,[Sale Amount]*.1,[Sale Amount]*.15)

Expr1 will represent the field to be calculated.

(k) Use a query to find selected information. This is a select query.

(l) Select query with specified criteria information.

(m) Another select query with specified criteria information.

(n) This question asks you to create a report. Based on the information required you should
be able to tell what tables or queries one should use to create the report.

Question 3 - Word processing (refer to the previous lessons on word processing tips)

In this question the following is asked of you:

(a) Combine two word files and save under a new name on your diskette. (Copy the
information from both files to a new document and save as the name given).

(b) Underline some text within the newly saved document. (Highlight the text and select
underline).

(c) Indent two areas in the document. (This can be done by placing the cursor in front of
these areas and pressing tab)

(d) Insert the information given as a table and place as the last paragraph in the document.

(e) Insert specified text as the title of the document; it should be two lines above the
content of the document. It should be formatted to be bold, centred, and of Arial font size
20.

(f) Set the document to the following

i. 8.5" by 11" and landscape orientation.


ii. The top and bottom margins to 0.25" and the left and right margins to 0.5".

(g) Set the line spacing of the second paragraph to be 1.5" (Highlight the entire paragraph
then select 1.5" for line spacing). Remove underline from a specified text in this paragraph.

(h) Place the text of the document into two newspaper columns. According to what should
be in the first and second columns. Make use of column breaks to achieve this. The title of
the document should not be affected.

(i) Insert a footer to the right of the document with your candidate number.

(j) Insert a page number at the top left of the page.

(k) Replace all occurrences of a certain word with another. (The find and replace tool can be
used to do this. Press CTRL+ f and the window will pop up giving you the option to find and
replace)

(l) Change the case of a specified text to uppercase. (You may highlight the text, right click
it then click font-> from there click the check box with uppercase)

(m) Interchange two paragraphs and save the file on your diskette as the name specified.

(n) Retrieve another file from your diskette.

(o) Insert the column chart created in the Spreadsheet question. (Simply copy the chart and
paste it into this word document.) Insert a footer, your candidate number at the centre.

(p) Use your spreadsheet as your data source and insert the correct merge fields as
depicted in the document.

(q) Merge the data source with the original document and save as directed.

The questions previously presented, as well as suggestions for some, can be completed
correctly with practice. Also, review the previous lessons on word processing, spreadsheet
and database management tips.

We have come to the end of another interesting lesson. See you next week and remember
to work not hard, but very smart.
Information technology
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be exploring a database management tool, the
query, which is one of the most important in the practical aspect of the examination.

What are queries?

Queries are used to extract data from a database. Queries ask a question of data stored in a
table. For example, a query could display only students who checked out biology books in a
database.

For more information on the how-tos of Microsoft Access©, visit office.microsoft.com or


use a search engine to find how to do a specific task.

Lastly, practising before the exams by way of your SBAs or past papers can help you to gain full
marks. See you next week and remember to work not hard, but very smart.
Creating charts in a spreadsheet
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be going through some spreadsheet tips for
the practical aspect of the examination.

Chart

A chart is a graphical representation of the data on a worksheet. It may either be embedded


where it is placed in the worksheet beside the data or may be placed on a separate sheet.
Regardless of the method chosen, a chart is still linked to its respective data in the
worksheet.

Altering this data will subsequently alter the data on the chart. Excel has 14 different chart
types, but not all data are appropriate for every chart.

In this example, we will be focusing on the pie chart.

1. Create a worksheet that has rows and columns of information that can be used in a chart.

2. Select the range of cells containing the data you want plotted in the chart. If the data is not
next to the text you want to use as chart labels, use the Ctrl key to select the separate ranges.

3. Click on Insert>Chart, or click on the Chart Wizard button. Select a chart type in the Chart
Wizard. Select a chart sub-type. Click on Next.

4. The chart source data dialog box will appear. This dialog box shows a preview of the
chart and demonstrates what data are being used to create the chart. Click on Next.

5. Select the Titles tab. Type in a name for your chart.

6. Click on the Legend tab. This section lets you decide whether or not you want to display
your chart's legend. If you chose to display the legend, it also allows you to choose where
you want the legend displayed.

7. Click on the Data Labels tab. This section allows you to choose how you want to have your
data labelled. Click on Next.
8. Select where you want to place your sheet.

9. Click on Finish.

AutoFill

The AutoFill facility of Microsoft Excel saves on time when creating a spreadsheet. If our
spreadsheet involves the months of the year, we could type Jan for January in the first cell.
Put the cursor at the bottom right hand corner of this cell and a + will appear. Click and
drag this button 11 cells over and these cells are filled with the remaining 11 months. This
same principle can be used to fill cells with numbers that increase by a constant figure. For
example, if 0 is placed in the first cell and 5 in the second, the drag and routine of the + will
produce 10, 15, 20 in the other cells.

Database management tips


Nadine S. Simms, Contributor
Good day students. In today's lesson we will be going through a number of database
management tips for the practical aspect of the examination.

What is a database?

A database is a collection of information organised in such a way that a computer


programme can quickly select desired pieces of data. Data are held in tables, with each row
in a table being known as a record. Each record is divided into columns known as fields,
with each field containing certain data about that record. To access information from a
database, you need a database management system (DBMS). One such programme is
Microsoft Access©.

Database basics

When you open an Access file, whether existing or new, you will see the Database window.
This contains many objects, but in this lesson we will discuss only four: Tables, Queries,
Forms and Reports.

 Tables - Used to enter, store, organise, and view data. For example, one table could store
a list of students and their IDs, while another table could store books the students borrow.

 Queries - Used to extract data from a database. Queries ask a question of data
stored in a table. For example, a query could display only students who checked out
biology books.

 Forms - Used to enter, edit, or view data stored in a table or a query.

 Reports - Used to display and print select information from a table in a visually
appealing customised way.

Creating a database

Open Microsoft Access, Click File>New (the new file pane will open). In this pane, click Blank
Database (a dialog box will open). Enter the name of your database and select where you want to
save, in this case your 3 1/2-inch Floppy Disk, click Create.
Tables

Creating a table - in the database window select Tables> (look in the pane to the right and
double- click>Create Table in Design View. This will now open a new window with three
columns [similar to the one shown here]. The field name represents the column headings
for your table, data type - the type of data that will be stored - and description (optional) of
the information that is stored.

Having entered your column heading information, click the datasheet view button to view
your table and enter the information.

 Primary key - a unique identifier of a table, usually a number, such as a student ID,
or a product asset tag, etc.

Queries

Queries are used to extract information from the database based on criteria that you define.

Click the Queries icon. Double-click on Create Query in Design View. The Show Table dialog
box then appears listing all of the tables in the database. Click the name of the table that
contains the fields you want to use in the query. Click the Add button. Repeat for each table
you want to add. Click Close when you finish adding tables. The Query Design view window
then opens. The tables you selected appear in the top pane of the Query Design view. Click
Close when you finish adding tables. The Query Design view window then opens. The tables
you selected appear in the top pane of the Query Design view. You can then add the fields
you need by double-clicking on the field in the table in the top pane. You can specify the
information you want in your queries and complete simple calculations in the criteria fields
that appear below the fields you have selected.

Relationships

Relationships are very important in Microsoft Access. Many times, students will run queries
and they are incorrect as they contain duplicate information. This is so because they did not
create a relationship between their tables. When you create a relationship between tables,
the common fields are not required to have the same names; rather, the common fields
must have the same data type and the same Field Size (you would have selected this when
you created your tables). Click the relationships button on the Design tab in the
Relationships group, click Show Table. The Show Table dialog box displays all of the tables
and queries in the database. To see only tables, click Tables. To see only queries, click
Queries. To see both, click Both. Select one or more tables or queries and then click Add.
Drag a field (typically the primary key) from one table to the common field (the foreign key)
in the other table. The Edit Relationships dialog box appears. Click Create. Microsoft
Access© will then draw a relationship line between the two tables.

Forms

Forms are an easy way to enter, edit and view data (Figure
1). Any table or query can be converted into a form. Forms
can include fill-in-the-blank fields, check boxes, lists of
options, etc.

Creating a form

Click the Forms icon in the Objects bar. You will see two
options in the Database window: Create form in Design
view and Create form by using wizard. Double-click Create
form by using wizard. The Form Wizard dialog box will open. In the Form Wizard dialog box,
select your table from the Tables/Queries dropdown menu. Double-click or use single arrows
to choose fields from the Available Fields list. Having selected your fields, click Next. Choose
a design for your form (for example Columnar, Tabular and Justified) by clicking one of the
radio buttons. You can preview the design as you click the buttons. Choose a style for your
form by clicking one of the styles from the list. Type in a name for your form in the dialog
box and click Finish.

Reports

We will look at creating reports using the Wizard.

Double-click Create report by using wizard. The Report Wizard dialog box will open. In the
Report Wizard dialog box, select your table from the Tables/Queries dropdown menu.
Double-click or use single arrows to choose fields from the Available Fields list. Once you
have all the necessary fields, click Next. In the next step you can add grouping to your
report by selecting one of the fields (see picture). Choose a sorting order for the data in
your report. Select fields from the dropdown boxes and assign either Ascending or
Descending sorting order by clicking the appropriate buttons.

Click Next. Choose a layout and orientation for your report by clicking the radio buttons.
Click Next. Choose a style for your report by clicking on a title form the list. Click Next. Type
in a name for your report in the dialog box (don't use spaces or special characters) and click
Finish. You will see the print layout of your report.

For more information on the 'how tos' of Microsoft Access©, visit the website at
office.microsoft.com or use a search engine to find how to do a specific task. Lastly,
practising before the exams by way of your SBAs or past papers can help you to gain full
marks.

We have come to the end of another interesting lesson. See you next week and remember
to work not hard, but very smart.
Spreadsheet tips for practical exams
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be going through some spreadsheet tips for
the practical aspect of the examination.

Spreadsheet tips

A spreadsheet refers to a programme used for accounting, budgeting and other types of
number-crunching tasks. A spreadsheet helps you manage, analyse and present
information. It also refers to a document that stores data in a grid of rows and columns.
Rows are labelled using numerals (1, 2, 3, etc) while columns are labelled with letters (A, B,
C, etc). Two popular spreadsheet programmes are Lotus 1-2-3 and Microsoft Excel.

Spreadsheet basics

Movement Key stroke


One cell up up arrow key
One cell down down arrow key or ENTER
One cell left left arrow key
One cell right right arrow key or TAB
Top of the worksheet (cell A1) CTRL+HOME
End of the worksheet (last cell containing data) CTRL+END
End of the row CTRL+right arrow key
End of the column CTRL+down arrow key

Adding worksheets, rows, columns and cells

Worksheets: Add a worksheet to a workbook by selecting Insert > Worksheet from the
menu bar.

Row: To add a row to a worksheet, select Insert > Rows from the menu bar or highlight the
row by clicking on the row label, right-click with the mouse and choose Insert.

Column: Add a column by selecting Insert > Columns from the menu bar, or highlight the
column by clicking on the column label, right click with the mouse and choose Insert.

Cells: Add a cell by selecting the cells where you want to insert the new cells,

Click Insert > Cells > click an option to shift the surrounding cells to the right or down to
make room for the new cells.

Resizing rows and columns

Click the row or column label and select Format > Row > Height or Format > Column >
Width from the menu bar to enter a numerical value for the height of the row or width of
the column.
Selecting cells

Before a cell can be modified or formatted, it must first be selected (highlighted).

Cells to select mouse action


One cell click once in the cell
Entire row click the row label
Entire column click the column label
click the whole sheet button (upper left corner of the labels 'empty
Entire worksheet
label')

Cluster of cells drag mouse over the cells or hold down the SHIFT key while using the arrow
keys.

Formulas

Formula bars

Formulas are entered in the worksheet cell and must


begin with an equal sign "=". The formula then
includes the addresses of the cells whose values will
be manipulated with appropriate operators placed in-
between. After the formula is typed into the cell, the
calculation executes immediately and the formula itself
is visible in the formula bar. See the example to the
right to view the formula for calculating the subtotal
for a number of textbooks. The formula multiplies the
quantity and price of each textbook and adds the
subtotal for each book.

Relative, absolute and mixed referencing

Calling cells by just their column and row labels (such as "A1") is referred to as relative
referencing. When a formula contains relative referencing and it is copied from one cell to
another, Excel does not create an exact copy of the formula. It will change cell addresses
relative to the row and column they are moved to. For example, if a simple addition formula
in cell C1 "= (A1+B1)" is copied to cell C2, the formula would change to "= (A2+B2)" to
reflect the new row. To prevent this change, cells must be called by absolute referencing
and this is accomplished by placing dollar signs "$" within the cell addresses in the formula.
Continuing the previous example, the formula in cell C1 would read

"= ($A$1+$B$1)" if the value of cell C2 should be the sum of cells A1 and B1. Both the
column and row of both cells are absolute and will not change when copied. Mixed
referencing can also be used where only the row or column is fixed. For example, in the
formula "= (A$1+$B2)", the row of cell A1 is fixed and the column of cell B2 is fixed ($
appears before row number, however, it doesn't appear before column name; row is fixed
and column isn't).

Basic functions
Functions can be a more efficient way of performing mathematical operations than formulas. For
example, if you wanted to add the values of cells D1 through D10, you would type the formula
"=D1+D2+D3+D4+D5+D6+D7+D8+D9+D10". A shorter way would be to use the SUM
function and simply type "=SUM (D1:D10)". Several other functions and examples are given in
the table below.

Function Example Description


SUM =SUM (A1:A100) finds the sum of cells A1 through A100
AVERAGE =AVERAGE (B1:B10) finds the average of cells B1 through B10
returns the highest number from cells C1
MAX =MAX (C1:C100)
through C100
returns the lowest number from cells D1
MIN =MIN (D1:D100)
through D100
SQRT =SQRT (D10) finds the square root of the value in cell D10
returns the current date (leave the parentheses
TODAY =TODAY ()
empty)

Page setup

The page set-up allows you to format the page, set margins and add headers and footers.
To view the Page Setup, select File > Page Setup from the menu bar. Select the Orientation
under the page tab in the Page Setup dialog box to make the page Landscape or Portrait.
The size of the worksheet on the page can also be formatted under the Scaling title. To
force a worksheet to be printed on one page, select Fit to 1 page(s).

Margins

Change the top, bottom, left and right margins under the Margins tab. Enter values in the
Header/Footer fields to indicate how far from the edge of the page this text should appear.
Check the boxes for centering Horizontally or Vertically to centre the page.

Header/Footer

Add preset Headers and Footers to the page by clicking the drop-down menus under the
Header/Footer tab. To modify a preset Header or Footer, or to make your own, click the
Custom Header or Custom Footer buttons. A new window will open allowing you to enter
text in the left, centre or right on the page.

The information provided here, along with practice questions, should give you maximum
marks on your practical examinations

Word processing feature - mail merge


Nadine S. Simms, Contributor

Good day students. In today's lesson, we will be going through a word processing feature
for the practical aspect of the examination, mail merge.

Word Processing tips for the practical exam


In last week's lesson, we explored some general tips for the word processing aspect of the
practical exam. Today, we will be concluding this by looking at mail merge.

What is mail merge?

1. The process of combining a list (usually of addresses) into another document (usually a
letter or envelope).

2. A word processing feature that permits personalising a form letter by merging the letter
document and a name-and-address file before printing.

Why mail merge?

The mail merge feature is used mostly in businesses where a company may want to send a
standard letter to its customers. Instead of editing each letter individually to input different
personal information, the mail merge feature is used. This is done by having two
documents, one with a listing of the customers' personal details and the other, the standard
letter. These two documents are then 'merged' to create personalised final letters for each
customer.

 Select Create. This is the only option available. (Image 3)

Once you have selected Create, a window will appear in the middle of the screen asking you to
start typing in the details of your customers. (Image 4)

You will notice that the addresses are set out in an American format, as most big software
companies are American. A bit of tweaking is necessary to Customise the database.

 Select Customise and the (Image 5) will appear.


 Add, delete and rename fields until you are left with just Title, First Name, Last
Name, Address Line 1, Address Line 2, Town, County and Postal Code. (This
may vary with what the question is asking of you.)

 Click OK and enter the details of the customers. After completing entering the data
for each customer, select New Entry until you are finished. Close the dialog box.

 When you have added details of all your customers, a window will appear and here is
where you give a name to your database.

 Give your database a name and click Save.

NB: You can save the database to anywhere you choose; it doesn't have to be My
data sources as in the window.
 A window will appear where you may sort your data. If no sorting is necessary just
click OK.

 At the bottom of the right-hand side of the screen, you should be on step three of
six.

 Select Next: write your letter and go to step four.

Now it is time to put in the details of your customers. On the right-hand side, you should
see something that looks like (Image 6)

Select More items and a window similar to (Image 7) will appear. Before you start entering
the details, make sure that your cursor is in the desired spot in your letter.

 Select the merge fields and add them.

You will need to close the Insert merge field window to move your merge fields around on
the page.

To show the merge fields again, select More items on the right of the screen.

Repeat this process until you have entered all your merge fields in their correct places.

Note (Image 8)

Note that there are spaces between the Title, First name and Last name fields. If you
don't leave the spaces then names will all run together, for example: MrDowJones.

 In the bottom right-hand corner, select Next: preview your letters.

The letter that appears should contain the details of one of your addressees.

 Go to step six, by selecting Next: complete the merge.


 Select Edit individual letters and merge all of them; the mail merge is complete.

This new (scrollable) document should contain completed letters to each of the people in
your database. Make sure you save all the documents.

Congratulations, you have completed a mail merge!


The mail merge process

 This explanation we will be using mail merge to prepare a letter.


 From the five options that now appear, select Letters, then Next: starting document.
(image 1)

The window on the right changes to step two of the mail merge process and gives options to
Use the current document; start from a template or start from an existing document.

 Select Use the current document. (Image 2)

Now, at the bottom, select Next: select recipients.

The database of addressees is still to be created and the window on the right is asking us to
select recipients (customers).

 Create a new list by selecting Type a new list. (Image 3)

We have come to the end of another interesting lesson. See you next week and remember to work
not hard, but very smart.
Answers to practice programming questions
Nadine S. Simms, Contributor

Good day students. In today's lesson we will complete programming by giving the answers to
last week's questions.

1. a. Logical errors are those errors caused by a mistake in programming instructions. They
cause a programme to operate wrong or to produce incorrect results but don't stop the
programme from working while syntax errors are those that result from not obeying the rules
of the programming language.

b. A source code is an original programme written in a high-level programming language


while an object code is obtained from compiling the source code.

c. Compiling is the process whereby a compiler translates the entire source code (all
statements) to its object code before execution takes place while execution is simply the
process by which the instructions are carried out so as to obtain useful information.

d. Machine language is a programming language consisting of data and instruction as coded


binary digits, zeroes and ones. No translation is necessary for the computer to understand
this language while the assembly language is another low-level language. However, it uses
mnemonics, which are letter codes to each machine language instruction.

e. The while loop is a type of construct in which the loop is repeated for an unspecified
number of times until a condition is met while the For loop is a type of looping in which the
loop instructions are repeated for a definite number of times, such as 10, 20 or 30 times.

2. State what each of the following operators means:

a. >= ? greater than or equal to

b. = ? equal to

c. <= ? less than or equal to

d. < > ? not equal to

3. Numcount = 0
Sum =0
Largest = 0
Smallest = 0

Read Num
While Num < > -1do
Sum = Sum + Num
Numcount = Numcount +1
If Num> Largest
Largest =Num
Endif
If Num<Smallest
Smallest = Num
Endif

Read Num
Endwhile
Print Sum, Largest, Smallest

4. Read N
Count = 0
Nonzero = 0
Zerocount = 0

FOR Count = 1 to N DO
Read X

If X=0
Zero = Zerocount +1
ENDIF
IF X ? 0
Nonzero = Nonzero + 1
ENDIF
Count = Count +1
ENDFOR
PRINT= Nonzero, Zerocount

5. YOUNGAGE = 0
For j = 1 to 5
Read NAME, AGE
If AGE< YOUNGAGE then
YOUNGAGE = AGE
YOUNGPERSON= NAME
Endif

Endfor
Print = "The youngest person is ", YOUNGPERSON
Print = "Their age is ", YOUNGAGE

6. Read SCORE
If SCORE >= 85 then
Print = A
Else if SCORE >= 65 then
Print = B
Else if SCORE >= 50 then
Print = C
Else
Print = F
Endif

7.
N SUM Print N Print SUM
20 20 20 20
23 43 23 43
26 69 26 69
29 98 29 98
32

Hence that which is printed for 'N' is N= 20,23,26,29

And that which is printed for 'Sum' is SUM = 20,40,69,98.

8.a. Four lines of code are in the programme.

b. The user had input "Mary" and "16".

c. Example 1 converts the code one line at a time.

d. The left side of the arrow represents the source code.

e. Example 2 represents the compilation process.

f. The result would be:

i. John

ii. 21

iii. Hello John

iv. You are 21

We have come to the end of another interesting topic in our series of lessons. See you next
week and remember to work not hard, but very smart.
Some programming questions
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be practising some programming questions.

Programming questions

Practise the following programming questions, then keep your answers close by and check
them against those that will be given in next week's lesson.

1. Explain the difference between the following:

a. Logic and syntax error

b. Source and object code

c. Compiling and executing

d. Machine language and assembly language

e. While loop and For loop

2. State what each of the following operators means:

a. >=

b. =

c. <=

d. < >

3. Write a pseudocode algorithm to read a set of positive integer (terminated by -1) and
print their average as well as the largest and smallest of the set.

4. Write a pseudocode algorithm to read a positive integer X followed by N integers. For


these N integers, the algorithm must count and print the number of zero and number of
non-zero values.

5. Write an algorithm to read the names and ages of five people and print the name and
age of the youngest person. Assume that there are no persons of the same age. Data are
supplied in the following form name, age, name, age, etc.

6. Write an algorithm to read an integer value for SCORE and print the appropriate grade based
on the following.

SCORE Grade
85 or more A
Less than 85 but 65 or more B
Less than 65 but 50 or more C
Less than 50 F

7. What is printed by the following algorithm? * (Hint: use a trace table to answer)

SUM = 0
N = 20
WHILE N< 30 DO
SUM = SUM = N
PRINT N, SUM
N= N + 3
ENDWHILE

8.Consider the following two samples of programming code (see diagrams 1 and 2).

The result of executing the code is shown either on the right side or below the arrow.

a. How many lines of code are in the programme?

b. State what was input by the user.

c. State the example which converts the code one line at a time.

d. Using example 1, state which side of the ? arrow represents the source code.

e. Compiling translates all of the lines of the entire programme into another programme at
one time. State which example represents the compilation process.

f. State the result if John and 21 are input in example 2


Word-processing tips using Microsoft Word
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be going through some word-processing tips
for the practical aspect of the examination.

Word-processing tips

Word processing refers to the use of a computer to create, edit and print documents. Of all
computer applications, word processing is the most common. To perform word processing,
you need a computer, a special programme called a word processor (for example Microsoft
Word ©) and a printer. A word processor enables you to create a document, store it
electronically, display it on a screen, modify it by entering commands and characters from
the keyboard and print it on a printer.

Document Operations

Open - This is used to open an existing document that was saved to the computer or
external device.

New - This is used to open a new blank document in a new window while keeping the
existing document open.

Save - This is used to save a document that you are currently working on, replacing the
older version.

Save As - This allows you to give the document a new file name or save to a new location.
Both versions of the document will exist.

Delete - This will delete text to the right of the cursor.

Backspace - This will delete text to the left of the cursor.

When you first open Microsoft Word© , the picture above shows what you will see
General tips

 You can convert text to table by selecting the text and Click on the table TAB, then
click Convert text to table
 In Mail Merge, be sure to place your fields in the correct location with appropriate
spaces.

For more information on the HOW TOs of Microsoft Word©, visit the office.microsoft.com
website or use a search engine to find how to do a specific task. Lastly, practising before the
exams, by way of your SBAs or past papers, can help you to gain full marks.
Writing a programme
Nadine S. Simms, Contributor

Good day students, in today's lesson we will focus on writing and running a programme. The
last few lessons have concentrated on writing pseudocodes. Today, we look at translating
those pseudocodes into an actual programming language. This is called the source code.
Having selected the programming language that is suitable to solve your problem, you may
start writing the programme. Note, however, that most programming languages have
different syntax and semantics that you must follow.

 Syntax: the way in which the statements in a programme must be written so that it
can be understood; the set of rules that must be followed which guides how the
different structures of the programming language must be used.
 Semantics: the meaning associated with words used or reserved by the
programming language, for example in C, the symbols && means AND.

Programme structure

All structured programmes follow a general arrangement.

# include <stdio.h> 1. Establish the beginning and end of the


void main () programme
{
printf("Sample C CODE") Sample C code where the { after the word 'main'
} represents the beginning and the } represents the end
of the programme. The programme is printing Sample
C CODE.

# include <stdio.h> 2. Declare variables


void main ()
{ It is important to declare our variables when writing
int age out programmes because they occupy space in
} memory that we can use to assign values and the
Here we have declared a variable compiler needs to know, in advance, the type of data
age type of integer. that will be stored in it. These types include:

 Integer - stores whole numbers


 Real - stores fractional numbers in the decimal format

 Character - stores a single character such as a letter

 String - stores a collection of characters

# include <stdio.h> 3. Programme statements


void main ()
{ Lastly, there are the programme statements. This
int age consists of a combination of the various constructs
} that each programming language has. The proper
Here we have declared a variable
age type of integer.
use of the different loops (for and while) and the various selection structures (IF, IF-ELSE
and NESTED IF).

Running a programme

The process of running a programme consists of a few steps. First, we prepare our
algorithms and then we write the programme code using a text editor [source code]. A
compiler will then compile the source code to get an executable file or object code. We will
then run the object file to obtain the output.

Source code to object code

To get the object code from the source code, we use a translator programme. Three types
of such programmes are interpreters, compilers and assemblers.

Interpreter

Translates the source code, line by line. If an error is detected, translation is stopped. This
process is repeated for every instruction in the programme and until an error-free
translation presents the object code.

Compiler

Translates all instructions at once and produces a stand-alone object code that can be
executed. It also checks for errors and produces an error summary if any is found.

Assembler

Translates mnemonic-type instructions [Assembly Language] to machine code. It is different


from the compiler and the interpreter as it translates low- level languages while they
translate high level.

Programming errors

There are different types of programming errors that may be generated when a programme
is executed. These include syntax, logic and run-time errors.

Syntax errors

These occur when a mistake is made in the language rules or sentence structure of the
programming language. Eg - In the C programming language, typing 'print' when it should
be 'printf'.

Logic errors

These occur when the programmer makes a mistake in programme sequence. The
programme will run but produce incorrect results. Eg - Using > when < is what was
required.

Run-time errors
These occur when the programme is being run. They are normally due to unexpected events
that cannot be completed by the compiler. Eg. - dividing by zero (0).

Debugging and programme execution

Debugging refers to the process of error detection in the source code of our programme. We then
try to understand why the error occurred and make corrections. Tools and processes available to
a programmer to debug a source code include:

Tools/process
These are programmes that help programmers to detect errors.
Debuggers
Traces These are printouts that show the flow of programme statements,
step by step.
Variable checks These convey the value of variables at various points in the
programme.
Failure point A printout of the values in memory at the time the programme
failed.
The programmer halts execution to check what is happening in
Break point
memory.
Step mode Run a programme one line at a time to identify errors.

Having translated your programme, the final step is to execute it. Two commonly associated
terms with programme execution are:

 Programme loading: Copying of a programme from the hard disk of the computer
to memory so it can be used.
 Linking: Combining various parts of a programme to produce a single executable
file.
Testing an algorithm
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be exploring the various methods of testing an
algorithm.

Desk checking is a way in which programmers test the logic of an algorithm. This is done by
executing the statements of the algorithm on a sample data sheet. Logic is very important
as it determines whether the problem posed is solved or not. One way in which
programmers do this testing is through the use of a trace table.

Trace tables

A trace table is one that is completed by tracing the instruction in the algorithm with
appropriate data to arrive at solutions. It is also useful in testing one's skills in
understanding how the IF, WHILE and FOR constructs operate.

For each algorithm that is being traced, a table is created since it enables better
organisation of data. It contains columns drawn for each variable used in the algorithm and
enough rows to store the values created.

Points to note:

 When completing the trace table, start from the top of the algorithm by writing the
appropriate value in the first vacant cell for the variable which is currently being
assigned a value.
 When calculating values, a variable can only store one item of data at a given time
and that the current value is the value to be entered in the vacant cell.

 When the values of the variable are to be printed, write these answers on the answer
sheet as soon as the values are obtained, rather than upon completion of the entire
table.

 When printing is required within the loop, several values for the same variable may
have to be printed for the same variable, dependent on the number of times the
print instruction was carried out.

 If printing is only required outside a loop, all of the values within the loop of the
variable to be printed may not have to be printed.

Example 1

Complete the following trace table:

X=1
Y= 2
Z =3
While Z< 45 DO
X= X + Y
Y = Y +X
Z=Z+Y
ENDWHLE

Solution 1

Step 1 Enter the variable in the top row and insert the initial value for each the variable in the
second.

X Y Z
1 2 3

Step 2 Always use the most recent value

X Y Z
1 2 3
3 5 6
6 11 17
17 28 45
45 73 118

Step 3 We stop here because Z is now greater than 45.

Example 2

What is printed in the following algorithm?

M =1
FOR N = 1TO 5 DO
M= M +2
ENDFOR
Print M,N.

Solution #2

M N
1 1
3 2
5 3
7 4
9 5

Therefore, that which is printed is


M= 9, N=5

NB FOR is a loop statement, hence we have to repeat the instructions between the FOR and
ENDFOR five times.

Practice questions

Do the following questions and then check your answers with those given in the box.

1. What is printed in the following algorithm?

FOR N= 6 TO 10 DO
PRINT N
ENDFOR

2. What is printed by the following algorithm when n= 5?

If (n=1) or (n=2) then


h= 1
ELSE
f=1
g=1
FOR j= 1 TO n-2 Do
h= f +g
f= g
g=h
PRINT h
ENDFOR
ENDIF
PRINT f, g
STOP

Answers
#1. 6, 7, 8, 9, 10
#2.
f g j h Print h
1 1 1 2 2
1 2 2 3 3
2 3 3 5 5
3 5

h = 2 f = 3, 5 g = 3, 5

We have come to the end of another interesting lesson. See you next week when we will
continue exploring programming, and remember, work not hard but very smart.
Programming
Nadine S. Simms, Contributor

Good day students. In today's lesson we will continue our exploration of programming by
focusing on the iteration programme construct, as well as on some other programming-
related content.

Iteration

Loops/Iteration: These are statements that are used when it is useful to repeat parts of a
programme. The programme will, therefore, continually execute a part of that block of
programme code until a stated condition is met. When the condition is met, it is said that the
loop is terminated. Upon termination, control will be returned to the first sentence after the
block that the loop is contained in.

The basic structure of the loop is:

Initialise a variable to a star value (usually determines whether or not the loop is executed)

Test variable against condition

Execute the body of the loop

Update the value of the start variable

There are two types of loop statements:

1. Indefinite: This refers to when you do not know beforehand how many times to repeat
the loop. (WHILE and REPEAT loops)

WHILE LOOP

General Form of the WHILE-DO loop


WHILE (condition) Statement
Example.

Age = 16
WHILE (age <21) DO
BEGIN
Output "You cannot drink"
Age = age + 1
END
Output "The loop has ended"

REPEAT LOOP
General Form of the REPEAT-UNTIL loop
REPEAT
Statement
UNTIL (condition)
Statement - False
Example.

Age = 16
REPEAT
Output "You cannot drink"
Age = age + 1
UNTIL (age <21)
Output "The loop had ended"

2. Definite: This refers to when you know beforehand how many times to repeat the loop. (FOR
loop)

General Form of the FOR loop


FOR <variable> := <start value> TO/DOWNTO <final value> DO
BEGIN
Statement 1
Statement 2
Statement 3
...
Statement n
END
Example
1. FOR age := 13 to 19 DO
Output "You are a teenager"
2. n = 3
FOR number := 1 to n DO"
Output "The number is", number
Output "Out of loop"
The result of this loop is:
The number is 1
The number is 2
The number is 3
Out of loop

Note:

i. The symbols := must go together

ii. Variable must be in order so it can be counted.


iii. Variable begins with start value.

iv. Loop variable is increased every time the loop goes around.

v. The loop will terminate/end when the counter reaches the value of the final expression

Arithmetic and Logic Operators

Arithmetic Meaning Logic Meaning


Operators (example) Operators (example)
Equal to(price = 40)
+ (plus sign) Addition (5 + 8) = (equal sign) where price contains
the value 40
Greater than (price
- (minus sign) Subtraction (60 - 52) >(greater than)
>50)
* asterisk Multiplication (10*40) <(less than) Less than(age< 18)
>=(greater than Greater than or equal
/ forward slash Division (100/10)
or equal to sign) to equal to (age >=21)
<=(less than or Less than or equal to
% percent Per cent (50%)
equal to sign) (age <= 17)
Exponentiation (power) <> (not equal to Not equal to
^ caret
(5 ^ 2) sign) (age<>18)

The Assignment Statement

The assignment statement is used to store a value in a variable after the operation (i.e.
+,-,*, or /) has been performed. The syntax of the assignment statement is as follows:

VARIABLE = Expression (i.e. what is to be calculated).

Examples of assignment statements are:

1. NUM1 = 5 (i.e. Store the value 5 in the variable NUM1)

2. SUM = NUM1 + 50 (i.e. Add 50 to the value stored in NUM1 then store the total in the
variable name sum)

3. Product = NUM1*SUM(i.e. Multiply the content of NUM1 by the content of SUM)

The output statement

The output statement is used to show the value of the variable or a constant, this is usual
achieved by using a screen or printer.
The output statement most often used by pseudocode developers is:

PRINT = VARIABLE

Example 3: Write the output statement for example 1 above.

Solution:

PRINT = SUM

example 4: write THE OUTPUT STATEMENT FOR THE EXAMPLE 2 ABOVE.

solution:

print =product

Please note that the content of the variable is printed or outputted and not the name of the
variable. For example, 1 the value of the sum which would have been 50 would have been
outputted and not the word SUM.

We have come to the end interesting lesson. See you next week where we will continue
exploring programming and remember, work not hard, but very smart.
Programme development
Nadine S. Simms, Contributor

Good day students. In today's lesson we will continue to explore programming by picking up
with the phases of programme development.

Algorithm design

What exactly is an algorithm?

An algorithm is the step-by-step instructions required to obtain the solution to a problem. It


is finite (that is, it must have a stopping point) and explicit (very clear). They are normally
written in pseudocode or pseudo-English.

Algorithm or pseudocode design generally has three structural components:

 Sequence - the ability of the programme to execute instructions in a step-by-step


manner.
 Selection - the ability of the computer to make decisions and alter the course of
action it takes. For example, IF statements

 Iteration (repetition or looping) - the ability of the computer to repeat a block on


instructions until a condition is met. Example: WHILE, FOR and DO-WHILE loops.

General terms

Statements and keywords: A statement is a description of an action or condition.


Keywords are instructions within the programme, such as READ, WRITE, DO, WHILE and
FOR.

Variables: A name that represents data and can hold many possible values. Variables can
be global (used in the entire programme) or local (used in one specific part of the
programme). A variable whose value does not change is called a constant.

Conditional Statements or selection: These are statements that allow a choice to be


selected in a programme.

IF-THEN Selection Structure

IF condition is true THEN execute statement.

IF is a keyword, ENDIF tells the computer that the structure is finished. IF the condition is
false the statement will be skipped.

Examples
1. IF mark = 90
THEN output "EXCELLENT"
ENDIF

2. Is Janet an adult?
Input thisyear
Input birthyear

Age = this year - birthyear


IF age >= 18 THEN
Output "Janet is an adult"
ENDIF

3. Add two numbers, if the total is greater than 80 print close to 100

READ number1, number2


Total = number1 + number2

IF total > 90 THEN


Output " Close to 100"
ENDIF

IF-THEN-ELSE Selection Structure

IF the condition is TRUE then statement T should be executed and statement F should not.

IF condition is FALSE then statement F should be executed and statement T should not.

Examples

1. Read two numbers and print the lower value

READ A
READ B
IF A < B
Print A
ELSE
Print B
ENDIF

2. Is Janet an adult?
Input thisyear
Input birthyear
Age = this year - birthyear
IF age >= 18 THEN
Output "Janet is an adult"
ELSE
Output "Janet is not an adult"
ENDIF
Exploring programming
Nadine S. Simms, Contributor

Good day, students. In today's lesson we will continue our exploration of programming. Last
week, we looked at the difference between a programme and a programming language, as
well as the four broad categories of programming languages. They can also be classified
according to the generations in which they fall.

Low-level languages

These are languages which are machine dependent; that is, when a code is written on a
particular machine, it can only be understood by that machine.

Under this category, we have the first two generations of languages.

First-generation language

These are also called machine languages and are characterised by ones and zeros which
make up a binary code. A sample instruction might be 10111000 01100110.

Second-generation language

These are also called assembly languages and are characterised by abbreviated words,
called mnemonics. A sample code might be 'ADD 12,8'.

High-level languages

These are languages that are machine independent; that is, when a code is written on a
particular machine, it is not limited to execution on that machine only, but can also run on
other similar machines.

Under this category, we have the last three generations of languages.

Third-generation language (3GLs)

These are designed so that it is easier for the programmer to understand. In this, a compiler
converts the statements of a specific language into machine language.

Fourth-generation language (4GLs)

These are designed to be closer to natural language than a 3GL. Languages for accessing
databases are often described as 4GLs. A sample instruction might be EXTRACT ALL
CUSTOMERS WHERE 'PREVIOUS PURCHASES' TOTAL MORE THAN $1000.

Fifth-generation language (5GLs)

Programming that uses a visual or graphical development interface to create the source
code. They are often described as very high level languages.
Solving the Problem and the Programme Development Process

The first part of a programmer's job is solving the problem. In doing this, there is a process
which most programmers follow, called the programme development process. It is divided
into two phases and consists of several steps.

Algorithm Phase

1. Define the problem that will be solved.

2. Design a precise and carefully planned algorithm to solve the problem.

3. Test the algorithm on paper using techniques such as a trace table (this will be explored
later).

Implementation Phase

4. Translate the algorithm into a programming language, such as Pascal, BASIC, C or C++.
A correct and precise algorithm should give an easy line-by-line translation into the
programming language. This will also suggest that that the translation will be free of:

i. Syntax errors - Errors that result from the programmer not obeying the rules or syntax
of the programming language.

ii. Logic errors - Errors that result from mistakes made by the programmer, such as
dividing by 0.

5. Test the programme to ensure the expected results are produced. If these results are not
produced, the programme should be debugged (the process of finding errors in the source
code and understanding why they occurred and finding ways to correct them).

Problem definition

In defining a problem, you need first to analyse it, and this includes the specification of
input, processing, output and storage. Having completed your analysis, you can write down
your results using an IPO (Input-output-processing) Chart.

Inputs - Information needed to solve the problem.

Processes - Steps needed to convert the input to output.

Outputs - The goal of the problem.

Below are examples of IPO charts

Example 1

Problem: Accept 3 numbers add them and show their total

Input Processing Output


num 1 read three nums.
num 2 add the three nums. total
num 3 output the total

Example 2

Problem: Accept number, add 20 per cent and show the result

Input Processing Output


num read number
result = num + (num * 0.20) OR result/total
result = num * 1.20
Programming
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be exploring a new topic, programming, which,
I must say, accounts for a substantial percentage of marks for the technical proficiency
theory examination. An excellent grasp of this topic is important for passing this exam.

PROGRAMMING CONCEPTS

Programme vs Programming Language

A programme is a sequence of instructions used by the computer to solve a specific


problem. The programme is written (coded) in a programming language, which is a set of
words, symbols and codes that enable the programmer to communicate the solution
algorithm to the computer. There are many programming languages. Each one has its own
vocabulary and set of rules called syntax, which governs how words and symbols are
combined to form instruction.

Four categories of programming language

1. Machine languages

2. Assembly languages

3. High-level languages

4. Natural languages

Machine language

This is the lowest level of programming language. It consists of a string of ones (1s) and
zeroes (0s) called binary digits. It is the only language that needs no interpretation for the
computer to understand it.

Assembly language

This is another low-level language. However, it uses mnemonics (letter codes to each
machine language instruction). A special programmer called an assembler converts each of
the mnemonic codes and translates it into its machine-language equivalent.

High-level languages

These are languages that closely resemble human language and need to first be converted
to machine language before the computer can carry out the instructions.

Natural language
These are the languages normally spoken by humans and comprehensible to humans.
However, it is very difficult for computers to understand it, due to vastness of vocabulary,
as the languages vary.

Difference between source codes and object codes

Sources codes are programmes written in a particular programming language which might
be converted to machine language so that the computer can understand it. Object codes are
machine codes which have been converted to machine language by the compiler.

Compilers

A compiler is a computer programme which translates source codes to machine language. It does
so, first, by converting the codes of the high-level language and storing it as object codes.
However, it is done before run time, which makes the execution time faster than that of an
interpreter.

Source Code ---------> Compiler -------------> Object Code

Figure 10.1 A diagrammatic outline of the compilation process.

Object code -----------------> CPU

Figure 10.1 A diagram showing the run time of a compiled programme.

Interpreters

These are a set of codes or a programme that is used by some programming language to translate
source codes to machine language. They do so while the programme is being executed, and
translated codes are not saved, therefore, making it necessary for translation to take place each
time the programme is executed.

Source Code ---------> Interpreter -----------> CPU


Trends and jobs in technology
Nadine S. Simms, Contributor

Good day students. In today's lesson, we will be exploring trends in technology and jobs in
information technology.

Artificial intelligence

This is the branch of computer science that deals with making computers behave like
humans. It includes:

 Game playing: humans play against computers in games such as chess.


 Expert systems: computers are programmed to make decisions.

 Neural networks: computers are programmed to simulate the actions of the brain.

 Robotics: computers are programmed to respond to sensory stimuli.

Design and manufacturing

 CADD: Computer Assisted design and Drafting software is used to aid in the design
and drafting of a product. It is used to create two- and three-dimensional
engineering and architectural drawings.
 CAM: Computer Assisted/Aided Manufacturing software assists engineers and
machinists in manufacturing or prototyping product components. It is a programming
tool that makes it possible to manufacture physical models of a product.

 CAE: Computer Assisted Engineering is used in the different fields of engineering. It


involves data collection, analysis, manipulation, reporting and communication. The
form in which the data come varies with the field of engineering.

Business

Computers in business are quite extensive. They range from the desktop the receptionist
uses to the mainframe used as a server. There is also teleconferencing and telemarketing.
The former enables video and voice transmission over long distances and can be done
between branches and continents, while the latter refers to individuals calling potential
customers to market goods and services. In telemarketing, the phone calls are sometimes
made by computers.

Desktop publishing

This is also known as DTP and refers to the combination of a personal computer and
WYSIWYG [pron. Wizziwig] (What You See Is What You Get) page layout software to create
publication documents for either large or small-scale publishing.

Jobs in information technology

Data processing manager


Responsible for planning, coordinating, managing and staffing of the data processing
department of a large organisation. Must be aware of the latest developments in the IT
field.

Database administrator

Responsible for the administration and management of a company's database. This involves
the effective and efficient storage, retrieval, customisation and archiving of data. Also
responsible for developing procedures to ensure the security and integrity of the system.

Programmers

These can be classified into applications programmers (write software to meet user
requirements) and system programmers (write software for the system such as ones that
monitors and controls peripheral devices). Duties include writing, testing, debugging
programmes and updating and modifying existing ones.

System analyst

Looks at the operations of a manual or computerised system in an organisation and tries to


find solutions to end user problems by implementing a new computerised system or
upgrading an existing one.

Network administrator

Responsible for the creation, administration, and security of a company's network.

Computer consultant

Provides technical assistance and advice to an organisation in the formation or upgrading of


a data-processing department.

Data control clerk

Screens, edits and validates the input and output for a data-processing unit. Duties include
regulating workflow in accordance with operating schedules, being in charge of the receipt,
safekeeping and retrieval of data, hardware, software and security items.

Data entry operator

Enters data into a system in a form that is suitable for processing. Duties include: keeping
records on the data transcribed and verifying the data entered.

Computer engineer

Found at all levels of the computer industry, they design components for use in or with a
computer. Responsible for the maintaining and repairing of computer hardware sold to
clients.
Information technology and information in organisations
Nadine S. Simms, Contributor

Good day students. In today's lesson, we will be exploring information systems and
information in the organisation.

Information Systems

An information system refers to an organised collection, storage and presentation system of


data and other knowledge for decision making, progress reporting and for planning and the
evaluation of programmes. It can be manual, computerised or a combination of both.

Computer information systems can be chosen to suit different users and tasks.

Single-user: Only one person can use the computer system at any given time, while
having access to all the computer's resources.

Multi-user: Many users can use the computer system at any given time, while having
different access permissions and sharing the computer's resources.

Single-tasking: Only one programme can be used at any one time. This programme, while
being run, controls all systems resources, even if it does not need all.

Multitasking: Several different tasks or applications can be accessed simultaneously. In


this time, slices are allocated by the processor for each task.

Types of computer

Different types of computers are also associated with information systems. These include
personal computers, portable computers, mainframe, network computers and
supercomputers. These were discussed earlier in the series.

We will be exploring information systems through the context of commerce, manufacturing,


science and technology, education, law enforcement and recreation and entertainment.

Commerce

In commerce, computers are used in researching the sales potential of new products and to
automate the communication between customers and a company. They are also used in
checking stock levels and reordering when necessary.

Manufacturing

In manufacturing, computers are used to automate processes such as a car-assembly line.


These computers are sometimes called robots.

Science and technology


Information systems are used in weather forecasting, medical research and virtual-reality
simulations.

Education

In education, information systems can be seen in the classrooms with computer- aided
instruction and also for administrative purposes in keeping students' records.

Law enforcement

Computer systems are used in law enforcement to keep databases of felons and fingerprints
of same. They are also used in forensic computing, where samples of chemicals can be
compared, as well as voices and call logs. A database of driver's licences is also available.

Recreation and entertainment

In this, computers are used to edit music, photos and videos. They are also used to watch
movies and for high-performance game playing.

Information in organisations

Information as a commodity simply means that it can be bought or sold. As such, organisations
must take great care in selecting the type of information they require for business transactions.
They must also demonstrate the same diligence in protecting this information. Information is also
used in the decision-making arena for an organisation. As a result, information must be relevant,
accurate, timely, complete, in an appropriate medium and cost-effective.

These are the strategic, tactical and operational as seen in Figure 18.1.

Strategic Tactical Operational


Highest level, responsible for Middle level, responsible for Lower level, responsible for
deciding long term objectives of deciding how the resources of ensuring that specific tasks
th eorganization, Information the organization should be are planned and properly
required include overall reports, employed to achieve the goals carried out within a factory
future marketing prospects etc. set. Information required is or office.
Information is summarised and is more detailed than at the Example, working hours,
not intended for specific strategic level. Information is very detailed
decisions. and related to the present
operations and is prepared
frequently.
Data privacy
Nadine S. Simms, Contributor

Good day students. In today's lesson we will continue our exploration of unit three. Today's
lesson focuses on data privacy and information misuse.

Data privacy refers to the protection of data from computer crimes and ways in which the
integrity of data can be maintained.

Computer Crimes

These are illegal acts committed by using the computers and Internet. These crimes
include:

Unauthorised Access

Another name for this is hacking or cracking. It involves someone trying to electronically
break into a system to which the individual does not have authorised access. The purpose of
each individual hacker varies. Some hack as a means of game playing; to them, hacking is
solely to gain access to a system. Others hack for destructive purposes, in that they commit
acts of electronic vandalism, such as changing critical data.

Electronic eavesdropping

This is the use of electronic devices to monitor electronic communications between two or
more communicating parties without permission from any of those involved. It is good for
all parties involved if communication is encrypted. Most companies use encryption when
communicating.

Industrial espionage

This is when an organisation tries to gain an advantage over competitors by illicitly gaining
access to information about that competitor's strategies. In the past, this would be done by
break-ins and photographing of important documents. With the dawn of the Computer Age,
however, these companies are now hiring persons extremely competent in computers to
hack into their competitors' servers to gain information. It is done more easily if the
company has an accomplice in its competitors' organisation.

Surveillance

This refers to the use of computers and related technology to observe something or
someone with close scrutiny without permission. Implications include loss of privacy, lack of
security and the potential misuse of information. (We will explore this concept soon.)
Surveillance can be done through monitoring messages being sent, monitoring the use of
computer through the monitor's radiation emission and by the use of a bug to monitor
keyboard keystrokes.

Copyright and piracy


Copyright is the name given to the protection in law of the rights of person(s) responsible
for creating such things as text, a piece of music, a painting or computer programme. Piracy
refers to the illegal copying, stealing and selling of copyright items.

Information misuse

Organisations, in completing their jobs, collect a wide variety of information from a wide
variety of sources such as employees, customers, suppliers and competitors. This
information is normally provided for a special purpose that is in keeping with the mission
and objectives of the organisation. It is, therefore, important to put in place measures that
will ensure that information is not misused.

It is also quite common for information to be used for purposes which were not explicitly
stated when it was being gathered. For example, some websites may provide mailing lists to
other companies who then send items they think you may be interested in. Though you may
not mind, one should be able to choose whether one wants personal information to be made
available for others' use.

Some countries have legislation in place to help fight against information misuse.

For example: Information should only be used for the purpose for which it was provided.

Information should not be held for longer than necessary.

The privacy of the individual should be protected.

Terms related to the topic

Proprietary data: This refers to data and software developed and used exclusively by the
organisation. It is the software that must be often used by employees for day-to-day
operations.

Propaganda: This is the use of computer systems, more specifically the Internet, to
distribute harmful information that may be used to tarnish the image of an individual or, in
some countries, to sway public support in favour of one party, group or another in an
attempt to discredit the opposing group(s).

Computer fraud

Computers have contributed to a growth in electronic transaction processing and, as such,


have led to the emergence of computer-based fraud. In this, criminals use computers to
steal people's credit identities and use them for purchases or cash transfers. Another refers
to when an individual gains access to a financial account and changes the details of this
account to the owner's detriment and to the individual's advantage. Last, there is the
problem of illegitimate websites that require users to enter credit-card numbers and
passwords
Data security
Nadine S. Simms, Contributor

Good day, students. In today's lesson, we will be exploring data security and protection.

Data security

As we continue into the technological age, the need for computer security increases
drastically. A computer security risk is any event, action or situation that could lead to loss
or destruction of computer systems or data. These risks may be accidental or deliberate,
internal or external, and may result in an individual or organisation losing hardware and/or
software. To prevent this from happening, computers need to be protected or secured.
(Computer security refers to the protection of hardware and software resources against
their accidental or deliberate damage, theft or corruption.)

External sources

Deliberate damage

Computer users attempt to protect their centres physically by using locks, but still are
victims when memory chips, hard drives, CD and DVD drives, printers and inks are stolen.

Accidental damage

Natural disasters such as fires, storms, dust and humidity can damage data as well. Though
this is not deliberate, measures should be taken to prevent same. Such measures include
the use of fireproof cabinets and safes.

There is also the possibility of total system failure, which may be caused by a sudden loss in
electricity. In trying to prevent this, users and businesses should utilise surge protectors
and UPSes (uninterruptible power supply).

Internal sources

Deliberate damage

Users within the business environment can represent the greatest threat to a system's
security. This occurs when there is a planned attempt to access a system or data illegally.
Software access restrictions can be used to try and stem these attempts. Such restrictions
include passwords and access logs. Hacking is the unauthorised access and use of
networked or standalone computer systems to steal or damage data and programmes.

Accidental damage

This occurs through genuine mistakes made by users when accessing a system. This
includes overwriting recent data or entering incorrect commands, and forgetting user
passwords. Damage can occur if a virus is contained on an external storage device or the
Internet, which affects the system when accessed.
A computer virus is a programme that infects a computer negatively by altering the way the
computer works without the users' knowledge or permission. It may damage files and any
type of software that is on the computer.

Three main types of viruses

 Those that affect programme files.


 Those that infect system or boot files.

 Macro viruses which are written in a macro language associated with an application.

Other electronic threats:

 A worm, which is a programme that copies itself repeatedly, either in memory or on


a network, using up resources and possibly shutting down the computer or the
network.
 A Trojan horse is a programme that hides within or looks like a legitimate
programme and is triggered by a certain condition. The Trojan does not replicate
itself.

Preventing viruses

 Install antivirus software.


 Turn on virus protection.

 Try to be sure of the origin of each programme or file you use.

 Never double-click on an email attachment that contains an executable (.EXE)


extension.

 Do not click on website links sent through instant-messaging programmes unless you
are expecting the link.

Data protection

Data protection concerns the way in which computer users can protect their data against
loss or damage, and it also concerns protection laws which set down rules about what
information can be kept by others about an individual. Below is a list of measures that users
may take to perform computer protection.

Backups and archives

This includes making regular and recent copies of files and storing them on an external
storage device. By doing this, a user will always have a recent copy of his data, regardless
of what happens to the original.

Network and data communications

Valuable information is transferred electronically and can be intercepted by unauthorised


users. This threat can be addressed by encryption and decryption, where data are encoded
before transmission and decoded afterwards, and will appear unintelligible if intercepted.
Networks use user names and passwords to prevent unauthorised access to individuals'
files.

Virus protection

This can be used to protect a computer from and intercept harmful viruses attempting to
infect a system, as well as scan for same.

Fireproof cabinets and disc locking

The user may use fireproof cabinets and safes to store CDs, DVDs and other devices. Discs
can be locked by covering the write-protection hole. This prevents the changing, deletion or
infection of files contained on these devices.
The Internet
Nadine S. Simms, Contributor

Good day students. In today's lesson we will begin our exploration of unit three. The focus
is on the Internet and some networking-related terms.

The INTERNET

The Internet is described as a network of networks. It consists of over 50 million computers


worldwide. It was started in 1969 in the United States and has since expanded to almost
every country in the world. To access the Internet and the services it provides, we first need
to be connected to the Internet.

How do we connect to the Internet?

We connect to the Internet through a local Internet service provider (ISP). ISPs are
companies with direct connection to the Internet that grants access to subscribers, for
example Lime or Flow. These ISPs offer various technologies to users so they can connect to
the Internet. These vary in speed and cost. Such technologies include:

 Dial-up connection
 Broadband cable

 Digital Subscriber Line (DSL)

Definition of words and phrases commonly associated with the Internet:

World Wide Web (www) - one of the components of the Internet consisting of a
collection of text and media documents called web pages.

Web pages - a group of one or more related electronic documents. Multiple pages are
grouped to create a company's, individual's or group's website. Web pages are usually
encoded in a special language called Hypertext Mark-up Language (HTML) that allows one
web page to provide links to several others.

Website - a group of related web pages on the same server.

Web browsers - special software that allows users to view web pages, for example
Netscape and Internet Explorer.

Search Engine - the name given to a software or website that allows a user to find
information quickly by typing in keywords or phrases.

Hypertext Transfer Protocol (HTTP) - governs the transmission of web pages over the
Internet.

File Transfer Protocol (FTP) - the set of rules used to govern the sending and receiving
of files on the Internet. It enables us to find an electronic file stored on the computer
somewhere else and download it. It also enables us to upload (add information to the web).
These files are stored on what are termed FTP sites and are maintained by universities,
government agencies and large organisations.

Uniform Resource Locator (URL) - a unique address attached to each web page or
Internet file. For example www. informationtechnology.com

Features of the Internet

Electronic mail - permits the transmission of documents from one terminal or computer tof
another, via the Internet. The mail is stored in the recipient's mailbox and can be retrieved
at the recipient's convenience, using a password. The concept is similar to that of a postal
system.

Advantages of email

 Messages are sent instantly, thus increasing retrieval time.


 It is very convenient.

 Recipient can store, print, erase, edit or forward the message.

Disadvantages of email

 Increases the possibility of computer viruses being spread.


 We cannot send email to people who do not have an email account.

Bulletin board - similar to the normal bulletin board, it is a centralised computerised


location to which remote computers can connect. Once connected, a user may upload files
or download those posted by others.

News group - this may be one of several online discussion groups covering a parti-cular
subject or interest.

Internet relay chat (IRC) - this feature allows two or more persons from anywhere in the
world to participate in live discussions. Instant messaging programmes include ICQ, MSN
and Yahoo messenger.

Telnet - is one of the ways that a person can access a remote computer over a network
such as the Internet. It is often used by individuals or companies that seek to limit the
privileges of people who are logging on to their computer(s) via telnet.

Intranet - a type of network belonging to and is used exclusively by a particular company.

Extranet - allows authorised users limited access to an intranet.

ADVANTAGES OF THE INTERNET

 Information on virtually any topic can be found on the Internet.


 Cultural barriers can be broken.

 Computer files can be sent across continents.


 Interactive games and TV are on demand due to faster access times.

 Work from home.

 E-commerce.

 Access to professional feedback.

DISADVANTAGES

 Cost of equipment may be high.


 No control on the quality of information.

 Possible for hackers to gain access to confidential information on school and


government networks.

 Difficult to protect copyright material.

 Possible to download malicious content.


Data communication
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be exploring data communication, the last
topic that we will be covering from unit one of your syllabus.

Data Communication

As our world transforms from manual to digital, we must find new ways of transmitting data
and information to coincide with this transformation. Data communication is the process of
transmitting data, information and or instructions between two or more computers for direct
use or further processing over a communication channel.

How are computers connected?

Computers are linked in different ways - configurations. Two such are:

 Point to point: a direct link between two computers.


 Broadcast: using one computer to transmit data and information to serve the needs
of several terminals or computers connected to it in a network.

A network is two or more computers linked in order to share resources (such as printers and
CD-ROMs), exchange files or allow electronic communication.

Network Configuration

This refers to the size of the network, as they come in different sizes.

1. A Local Area Network (LAN) is confined to a relatively small area. It is generally limited to
a geographic area, such as a writing lab, school or building.

2. A Metropolitan Area Network (MAN) connects LANs in a metropolitan area and controls
data transmission in that area.

3. Wide Area Networks (WANs) connect larger geographic areas, such as a city, a country or
the world.

Network Layout

This refers to the physical layout of a network, that is, how the computers are connected
physically. Network layout is also known as the network topology. There are three main
types of network layouts: star, bus and ring.

Network type

Star layout - all the nodes are connected to a central hub Star

Advantages
 A break in a cable will not affect other computers
 Fastest

Disadvantages

 If the hub fails, the network fails


 More expensive to install

Bus layout - the network nodes are connected in a line

Advantages Bus

 Cheap and reliable

Disadvantages

 If the main cable breaks, network is split into two unconnected parts
 Slower than Star

Ring layout - there is no end to the connection because the first node is
connected to the last, forming a ring.
Ring
Advantages

 Can span a larger distance than Bus


 Transmission Faster than Bus

Disadvantages

 A break in the cable will affect all computers.


 Slower than Star

 Difficult to install

Communication channel is the method or medium used in data transmissions.


Characteristics of communication channels include transmission mode, direction of data
flow, bandwidth and transmission speed.

Transmission mode refers to the number of characters that can be transmitted in one
second. Two transmission modes are:

 Asynchronous: Data transmitted at irregular intervals, low speed at one character


at a time.
 Synchronous: Data is transmitted at regular intervals, high speed with large blocks
of data at a time.

Bandwidth: Refers to the width of the range of frequencies (the amount of data that can
be carried form one point to another) that data can travel on a given transmission medium.
Voiceband: Transmits data at a rate of 300 bps to 9600 bps. Cable commonly used is Unshielded
Twisted Pair (UTP).

Broadband: Transmits data at a rate of up to 1000s of characters per second. Cables commonly
used are coaxial and fibre optic.

Direction of data flow refers to whether data can be transmitted in only one direction or
more. Three types:

 Simplex: data travels in one direction only.


 Half-duplex: data travels in both directions but only one at a time.

 Full duplex: data travels in both directions simultaneously.

Transmission speed refers to the amount of information that a channel can contentedly
handle at any one time. Transmission speed is usually measured in bits per second (bps) or
character per second (cps).
Understanding user interface
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be exploring user interface.

What is the user interface?

How you interact with a computer and use it is referred to as the computer-user interface.
After the computer is booted up and the operating system loaded into memory, the user will
then see the user interface. The user interface enables the user to communicate with the
computer. There are generally three main types of user interfaces:

 Command-line interface
 Menu-driven interface

Pop-down menu: one that opens immediately below the position of your mouse (or other
pointing device). You move the cursor downward to go through the items in the menu list.

Pop-up menu: any menu list that pops up on the screen, on demand, to offer you a choice
of commands.

 Graphical user interface (GUI)


 User interface

Advantages and Disadvantages

Command-line interface - a type of user interface characterised by the user typing, using a
keyboard, commands directly for the computer to do.

 Faster to use once you have learnt the commands.


 For computer programmers, command- driven interfaces are cheaper to implement

 Requires less internal memory space.

 It is sometimes difficult to remember all the commands, therefore users have to


constantly refer to the software user manual.

 Restricts the user to using only the keyboard as the interface devices, while with
other interfaces a wide variety of input devices can be used.

 Commands must be entered at a special location on the screen and in a set format.
MS-DOS

Menu-driven interface

 This type of user interface is dominated by menus or lists that pop up or drop down
on the screen, and you are given a choice of items on the menu list.
 The user is presented with a list of options to choose from, without needing to
remember commands.
 Free from typing error, because the user does not have to type commands.

 A wide variety of input devices can be used to interface with a menu.

 Several steps required to issue a command.

 Once user has learned the menu system, it is bothersome to have to wait on the
package to present the questions before commands can be entered. Application
Software such as Microsoft Word, Excel, Access.

Graphical interface

 This interface makes use of pictorial representations (icons) and lists of menu items
on a screen, which enable the user to choose commands by pointing to the icons and
or the list of menu items on the screen using a keyboard, mouse or any other
pointing device.
 Once the icons are understood, very easy to use.

 Less demanding on the user as one is not required to remember any commands.

 Icons use much more memory space than either command-driven or menu- driven
user interfaces.

 The icons might be ambiguous; therefore, one might select an option and is
surprised to see the outcome. Operating Systems such as Windows XP or Vista.

Quiz

State the proper technical terms for EACH of the SIX phrases underlined in the
passage below.

1) John receives computer hardware from a friend who lives in Canada, but the software is
missing. He, therefore, decides to purchase the necessary software. In order for his system
to run, he realises that he would have to purchase software to manage the resources of
the computer as well as software which could provide for his particular needs. For
both types of software, he has a choice of two styles of interface; one which was command
driven or other which provides screen listing from which the user could select
appropriate functions. Some software provide user interfaces which display small,
graphical images that can be selected when the functions of the represented are
required. Since John intends to use the computer in his family business, he has a choice of
acquiring a software written especially for his business or general purpose software.
He notes, however, that if he purchases the general-purpose software, he would have to do
some modification to allow it to meet his specific need.
Understanding types of software
Nadine S. Simms, Contributor

Good day students, in today's lesson we will be exploring computer software.

What is software?

Software are simply computer programmes; instructions which cause the hardware
(printers, scanners, drives and so on) to do work. Software can be divided into a number of
categories based on the types of work done by programmes. The primary categories of
software are:

 System software
 Application software

System software

System software is the name given to the set of programmes that control or maintain the
operations of the computer and its devices. Two types of system software are the operating
system and utility programmes.

Application software

Application software is the name given to software programmes that are designed to make
users more productive and or assist them with personal tasks.

Other categorisations of software

Software can also be classified as:

 General-purpose software - these are programmes which are designed to cover a


single, but broad, application scope. Prime examples of this are programmes such as
Microsoft Word, spreadsheet operation or database management.

Advantages

 Many persons use it


 Help is readily available

 Updates are readily available

Disadvantage

 Does not meet the specific needs of the individual.

System Software Operating System (OS) Utility Programs


Definition A set of programs with instructions that work Most OS includes built-in utility
together to coordinate all the activities among
computer hardware resources. programs, however there are stand
alone ones available as well. A set of
programs that performs maintenance-
type tasks, usually related to managing
the computer, its devices and programs.

Functions 1. Start the Computer


1. Firewall
2. Provide a user interface
2. Backup Utilities
3. Manage Programs
3. Screensaver (built-in)
4. Manage memory
4. Virus, Adware and Spyware
5. Establish an Internet connection
Protection
6. Monitor Performance
5. Internet Content Filtering
7. Control a Network
6. Converting Files
8. Administer Security
7. Compressing Files
9. Provide File Management
Windows (Me, XP, Vista, Server series), Mac OS
Examples Kaspersky Antivirus, WinZip, WinRAR
X, UNIX, Linux

Specialised software packages

These are programmes designed to give the user a range of different tools for assistance in
completing a specific or narrow kind of task, rather than for a broad application area. An
example of this could be a programme especially designed for preparing and printing DVD
labels.

Advantages

 Makes work easier and more efficient for its users.

Disadvantage

 Does not meet the general needs of end users.

Software Type Purpose Example


Word Processing Write letters, reports and other Microsoft Word, Corel
WordPerfect, Lotus, WordPro
Database Management Organizing, Searching, Sorting Microsoft Access, Lotus
Data Approach, Filemaker Pro
Spreadsheet Finance and Budgeting
Microsoft Excel, Lotu 1-2-3

Presentation Slideshow Presentations to an Microsoft Powerpoint, Corel


audience Presentations
Desktop Publishing Microsoft Publisher, Quark
Production of Newsletters etc.
Express
Graphics Painting and Drawing Microsoft Paint, Corel Draw,
Adobe Photoshop
Production of detailed plans or
Computer-Aided Design (CAD) AutoDesk, AutoCAD
models in 3D
Integrated Software Combination of Major Application
Microsoft Works, Appleworks
Software

Custom-written software

This speaks to programmes which have been created specifically to meet the needs of a
particular individual or company. It is very similar to you going to a tailor for him to make a
suit to meet your fashion needs.

Advantages

 You get exactly what you want.


 Your software runs faster since the code is optimised to serve your specific purpose
only.

 You are in more control of revisions made to the software.

Disadvantages

 Its development is time consuming.


 Its development is very costly to the individual or company.

 Special training is necessary, which can also be expensive and time consuming.

Customisation of general-purpose software

Imagine having an article of clothing which does not quite suit you. You would take this
garment to the tailor and ask him to modify it to suit you. Customisation of general-purpose
software is just like this. A general-purpose software package is changed so that it satisfies
the needs of a specific user or company.

Advantages

 Meets the specific needs of the user


 More cost effective than designing custom-written software

Disadvantages

 Updates will not be as easily obtainable as with the general- purpose software.
Data representation
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be concluding data representation.

Representing alphanumeric characters

The combination of 0s and 1s used to represent characters are defined by patterns called a
coding scheme. Using one type of coding scheme, the number 1 is represented as
00110001.

Two popular coding schemes are American Standard Code for Information Interchange (ASCII)
and Extended Binary Coded Decimal Interchange Code (EBCDIC). ASCII is used mainly on
personal and mini computers, while EBCDIC is used primarily on mainframe computers.
Currently, ASCII is used on most microcomputers, and symbols are represented as a seven- or
eight-bit binary code. For the alphabet and numbers, these codes are sequential, where adding
one to each pattern gives the code for the character that follows, as is seen below.

ASCII SYMBOL EBCDIC


00110000 0 11110000
00110001 1 11110001
00110010 2 11110010
00110011 3 11110011
00110100 4 11110100
00110101 5 11110101
00110110 6 11110110
00110111 7 11110111
00111000 8 11111000
00111001 9 11111001
01000001 A 11000001
01000010 B 11000010
01000011 C 11000011
01000100 D 11000100
01000101 E 11000101
01000110 F 11000110
01000111 G 11000111
01001000 H 11001000
01001001 I 11001001
01001010 J 11010001
01001011 K 11010010

Calculations using ASCII code

If the ASCII code for 'A' is 01000001, find the ASCII code for 'K'.
1. Convert the binary code to decimal. (01000001 = 65).

2. Determine how far the required letter is from the given letter. ('K' is 10 letters after 'A').

3. Add this number to the decimal value. (65 + 10 = 75).

4. Convert this decimal value to binary. (75 = 01001011 in binary).

Therefore, the ASCII code for 'K' is 01001011.

NB: This method can be used for any question of this type.

Parity

This is an error-checking system where the computer uses an extra bit in the form of 1s and
0s to verify that no errors have crept into a code as data is sent from one computer to
another. This extra bit is called a parity bit.

There are two types of parity:

i) Odd parity

ii) Even parity

Even parity

If a particular computer uses even parity, the parity bit is represented as a 0 or 1, so that
there is an even number of ones in the whole byte or word.

Odd parity

For odd parity, there must be an odd number of ones, hence the parity bit is represented as
a 0 or 1, so that an odd number of 1s result in the whole byte or word being odd.

Examples

1. Using an even parity on an eight-bit byte.

1 1001001

Parity bit underlined.

NB The parity bit contains a 1 to make up an even number of 1s.

2. Using an odd even parity on a 16-bit byte

0 110111101101100

Parity bit underlined


NB Because the 1s are already even - the parity bit is expressed as a 0.

Questions

1. (a) Explain the difference between odd parity and even parity.

(b) The ASCII representation for the letter 'D' is 1000100

(i) What is the ASCII representation of the letter 'A'? (Hint: C is three less than D)

(ii) What is the ASCII representation for the letter 'G'?

After you have tried them for yourself, but not before, check your answers with the ones at
the end of this lesson.

Answers

(a) With odd parity an odd number there is an odd number of ones while with even parity
there is an even number of ones.

(b) i 1000001

(c) ii 1000111
Representing positive and negative numbers
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be continuing data representation.

Representing Positive and Negative Numbers

There are three systems used to represent positive and negative numbers. These are:

 Binary coded decimal (BCD)


 Sign and magnitude

 Two's complement

Binary Coded Decimal (BCD)

In BCD a four-bit code is assigned to the positive (+) and negative (-) signs. + = 1110, - =
1111

When converting to BCD, each individual digit in a number is converted to its four-bit binary
equivalent just as seen in the table below.

Example.

Convert -213 to BCD

-213= 1111 0010 0001 0011 +397= 1110 0011 1001 0111
l l l l l l l l
V V V V V V V V
- 2 1 3 + 3 9 7

The same procedure goes for all other numbers.

Sign and Magnitude

In sign and magnitude, the leftmost bit indicates the sign of the number with 1 representing
the negative (-) sign and 0 the positive (+) sign. The remaining bits give the magnitude of
the number.

Example = -89 to sign and magnitude


Changing the positive number into binary

8910 = 10110012

Because the number is negative, the sign is represented as one (1).

Therefore the answer is written:

-89 = 1: 10110012

Sign: 1 Magnitude: last '0'

Two's Complement

In converting a number to two's complement. The number first has to be a one's


complement.

One's Complement refers to after the binary number is found and the bits are 'flipped' or
inverted. After having flipped the bits, by adding one to that new number, the two's
complement would have been formed.

Example - Converting -14 to two's complement

14 = 1110 in binary

Which is = 00001110 in 8 bits

000011102 = 111100012 (One's Complement) FLIP THE BITS ADD ONE


111100012 + 1 = 111100102 (Two's Complement for -14)

Calculate six minus three (6-3) using two's complement.

Steps to take in answering this question:

 Convert 6 to binary = 0110


 Convert 3 to binary = 0011

 The two's complement of (3) is therefore 1100 + 1 = 1101 same as (-3)

 Add the numbers six (6) and negative three (-3) :


0110 + 1101 = 100112

The number needs to be represented using 4 bits therefore the answer is written: 0011

This topic can be a bit difficult, so re-read the above notes as often as needed.

Questions

1).Find the sign and magnitude representation of the following:

a) 45
b) -96

2). Find the two's complement of the following:

a) 1001001

b) -48

3). Calculate the following using two's complement:

a) 7-6

b) 8-5

After having tried them for yourself, but not before, check your answers with the ones at
the end of this lesson.

We have come to the end of another interesting topic in our series of lessons in the CXC
information technology lectures. See you next week when we will complete our lesson on data
representation, and remember work not hard, but very smart.

b. 0011 b. 1: 11000002 b. 0100002


3) a. 00012 2) a. 01101112 1) a. 0:1011012
ANSWERS

Answers for last week's questions

Binary to Decimal
1 20110 9 11010
2 7110 10 2310
3 13410 11 24810
4 1710 12 22610
5 13610 13 2910
6 6210 14 11110
7 8510 15 15110
8 7010 16 22910

Decimal to Binary
1 100010012 11 110010002
2 100000002 12 101010112
3 001111112 13 100101102
4 110101012 14 000110112
5 001100012 15 000100112
6 011011112 16 101111012
7 111100102 17 110111102
8 110000002 18 010011112
9 010110012 19 010010012
10 000000102 20 100010002
Data representation
Nadine S. Simms, Contributor

Good day students. This lesson will focus on data representation.

Data Representation

Computers cannot understand everything humans can and vice versa. This has forced
computer personnel to develop a system of representing data. Some words often used by
these persons are:

Human Readable: Data that can be understood by humans. Printers and monitors produce
human- readable copies.

Machine Readable: Data that can be understood by computers. Disc drives and tape
drives produce machine-readable copies.

Data can be put into two broad categories:

1) Discrete

2) Continuous

Discrete data can only come from a limited set of values. There may be two possible values
or a million, but the set of values is still limited. What makes continuous data is not how
many numbers are after a decimal point but, rather, the fact that each figure may be one of
a continuous range of values. Digital data is discrete while analogue data is continuous.

1. Analogue

2. Digital

Binary Representation

Computers represent data in the form of electronic pulses (high and low voltages). When
digitised, data is represented numerically by way of the binary system, which consists of 1s
and 0s only. In our normal counting, we use 10 digits (0-9) so our method of counting is
base 10, also known as the decimal system.

A computer, however, uses base 2 (binary) and has digits representing values 0 and 1 only.
Since the digit can only take two values, it is a binary digit (bit). Eight of these digits make
a byte.
Binary addition rules:

Rule #1

0+0 = 0

Rule #2

1+0 = 1

Rule #3

1+1 = 0 carry 1

Rule #4

1+1+1=1 carry 1

N.B. Study these rules because your understanding these is vital to your mastering this topic.

What the bits represent


128 64 32 16 8 4 2 1
0 0 1 1 0 0 0 0
0 0 0 0 0 0 1 1
1 0 1 0 1 0 1 0
0 0 0 0 1 0 1 0
Binary number Calculating the decimal value of the binary number (see above table for bits)
00110000 1 x 16 + 1 x 32 = 48
00000011 1x1+1x2=3
10101010 1 x 2 + 1 x 8 + 1 x 32 + 1 x 128 = 170
00001010 1 x 8 + 1 x 2 = 10
Figure 9.1

Coverting Binary numbers to Decimal numbers

Find the power of 2 and multiply the answer by the corresponding binary digit. As seen below 20
* 1 = 1 and 25 * 0 = 0

Binary to Decimal
Equals this
This binary
1 1 1 1 1 1 1 1 decimal
number ...
number
27 26 25 24 23 22 21 20
128+ 64+ 32+ 16+ 8+ 4+ 2+ 1 = 225

Equals this
This binary
1 0 0 1 0 1 0 1 decimal
number ...
number
27 26 25 24 23 22 21 20
128+ 0+ 0+ 16+ 0+ 4+ 0+ 1 = 149

Figure 9.2
Coverting Decimal numbers to Binary numbers

2 170 Remainder
2 85 0
2 42 1
2 21 0
2 10 1
2 5 0
2 2 1
2 1 0

0 1

Figure 9.3

Therefore 170 in binary is 101010102 (reading from the bottom up).

Try the questions below and see the answers in next week's lesson.
Covert each binary number into a decimal number.

1. 11001001 = _____________ 9. 01101110 = _____________


2. 01000111 = _____________ 10. 00010111 = _____________
3. 10000110 = _____________ 11. 11111000 = _____________
4. 00010001 = _____________ 12. 11100010 = _____________
5. 10001000 = _____________ 13. 00011101 = _____________
6. 00111110 = _____________ 14. 01101111 = _____________
7. 01010101 = _____________ 15. 10010111 = _____________
8. 10101010 = _____________ 16. 11100101 = _____________

Figure 9.4

Covert each decimal number into a binary number.

1. 137= ____________________ 11. 200= ____________________


2. 128= ____________________ 12. 171= ____________________
3. 63= ____________________ 13. 150= ____________________
4. 213= ____________________ 14. 27= ____________________
5. 49= ____________________ 15. 19= ____________________
6. 111= ____________________ 16. 189= ____________________
7. 242= ____________________ 17. 222= ____________________
8. 192= ____________________ 18. 79= ____________________
9. 89= ____________________ 19. 73= ____________________
10. 2= ____________________ 20. 136= ____________________

Figure 9.5
m. (2 marks)

4. Explain the difference between primary and secondary storage. (1 mark)

5. Explain how you would know if a monitor has high resolution. (2 marks)

6. State whether each of the following can be described as

(a) soft copy

(b) hard copy

(c) both or

(d)neither

a. Sound

b. Microfilm

c. Visual display unit

d. Non-impact printer (4 marks)

7. For each application listed in the figure below, select the appropriate input device from the list
given.

Application Input device


A Cheque processing (i) Bar code reader
B Marking multiple (ii) Joystick choice exams
C Point of sale (iii) Graphic tablets
D Games (iv) Optical mark reader
E Architectural design (v) Magnetic ink character reader

Answers

1. Hard copy refers to a paper and permanent printout of information displayed on the
screen and soft copy refers to the digital copy of information displayed on a screen or saved
to a storage device.

2. CPU has two major subunits.

a. Control unit and arithmetic and logic unit


b. Control unit - responsible for the fetching and executing (carrying out) of instructions.
Arithmetic and logic unit deals with the processing of all instructions containing arithmetic or
involves checking the value of an item of data.

c. Random access memory

3. a. A peripheral device is external to the system unit and controlled by the CPU.

b. Two examples of a peripheral device are a mouse and a printer.

4. Primary storage refers to the internal memory locations that store data, instructions and
information while the computer is in the 'on' electronic state, while secondary storage refers
to the memory external to the main body of the computer (CPU) where programmes and
data can be stored for future use.

5. A user can identify if a monitor is high resolution based on the size (dimension) of the
monitor the resolution (1 dot = 1pixel. The more pixels per inch, the clearer the image) and
the colour specification (number of colours displayed).

6. a. Sound - (D)

b. Microfilm - (C)

c. Visual display unit - (A)

d. Non-impact printer - (B)

7. Answer (BELOW)

Application Input device


A Cheque processing (v) Magnetic ink character reader
B Marking multiple choice exams (iv) Optical mark reader
C Point of sale (i) Bar code reader
D Games (ii) Joystick
E Architectural design (iii) Graphic tablets
What are output devices?
Nadine S. Simms, Contributor

Good day students. In today's lesson we will be focusing on output devices.

Output is data that has been processed into a useful form called information. There are four
types of output: text, graphics, audio and video.

Output device

An output device is any component of the computer that is able to convey human-readable
information to a user. This device can be divided into two categories: soft copy output and
hard copy output.

Soft copy output devices

Devices produce what is referred to as temporary output, including output from the
computer monitor and audio from speakers.

Monitors are output devices that visually convey text, graphics and video information.
Information exists electronically and is displayed for a temporary period of time.

Features of monitors

Size: The dimension of the screen, which is measured diagonally.

Resolution: How clear or detailed the screen's output can be. Output is made up of tiny
dots, where one dot equals one pixel. The more pixels per inch, the clearer the image.

Colour: The number of colours displayed varies from 6-256 to 64 thousand-16.7M. The
more colours, the smoother the graphic.

Cursor/Pointer: The symbol that shows where on the screen the user is working.

Scrolling: This allows text or graphic to be moved up or down.

Hardcopy Output Devices

Devices produce what is referred to as permanent output. Data/Information is printed for


review away from the computer, for example, reports and pictures.

Printers are output devices that produce text and graphics on a physical medium such as
paper or transparency film.

 Impact Printers form characters and graphics on paper by striking a mechanism against
an inked ribbon that physically contacts the paper. The most commonly used impact
printers are:
Printer Advantage Disadvantage

Daisy Wheel Printer forms  Best Print quality  Very Slow


characters on petals like
 Cannot print graphics
typewriter keys. The petals
strike and inked ribbon to
produce a character.  Only one font can be
used at a time as
changing fonts require
changing the daisy wheel
Dot-Matrix Printer is an impact  Inexpensive  Slow
printer that produces printed
images when tiny wire pins on  Can Print multi part
a print head mechanism strike stationery
an inked ribbon. The ribbon
presses against the paper and
creates dots that form
characters and graphics.

Line Printer is a high speed  Very fast


 Very expensive
impact printer that prints an
entire line at a time. Two  Prints up to 3000
 Very loud
popular styles are the lines per minute
Band/Train printer and the
shuttle matrix printer.

Non- Impact Printers form characters and graphics without actually striking the paper. Some
spray ink while others use heat and pressure to create the images. The most commonly used non-
impact printers are:

Printer Advantage Disadvantage


 Quiet
Ink-jet Printer forms characters  Cannot produce multi
and graphics by spraying tiny  High Quality text and copy
drops of ink onto paper. graphics
 Ink can smear especially
 Able to print colour if it gets wet

 Faster than impact


printers

Laser Printer creates images  Very fast  Very expensive


using laser beam and powdered
ink called toner.  High quality printing
 Extremely quiet

 Can print in colour

 Quiet
Thermal Printer forms  Print tends to fade over
characters using chemically time.
 Inexpensive
treated paper. Two types
include thermal wax transfer
printers and dye sublimation
printer.

Types of monitors available

 CRT - This is short for cathode ray tube monitor which consists of a screen housed in
a plastic or metal case.
 LCD - This is short for liquid crystal display which is a lightweight thin screen that
consumes less power and space than a CRT monitor; this is usually found in laptop
computers.

 Gas plasma - This is a type of monitor technology that works by creating a matrix
of red, green and blue pixels from plasma bubbles that are turned on or off by
selectively powering them.

 Microfilm and microfiche - where output is printed on a roll of film and a sheet of
film, respectively. This method is faster and saves on space by condensing large
amounts of information, but takes a special device to print.

 Speakers are devices that produce audio output, such as music, speech and other
sounds.

Another hard copy device:

 Plotters are sophisticated printers used to produce high-quality drawings, such as


blueprints, maps, circuit diagrams and signs. Two categories of plotters are:
- Vector (drum, flatbed)
- Raster (pen, electrostatic)
Input devices
Nadine S. Simms, Contributor

Good day students. Today's lesson will focus on input devices. An input
device allows a user to enter data/programmes and commands into the
memory of a computer. They can be classified into two groups manual
input devices and direct data entry devices.

Manual input devices

Data is entered or transferred into the computer manually or by hand.

Direct data entry devices

Data is transferred automatically into the computer, for example from an electronic form or
barcode. Information is, therefore, not entered manually.

Other Input Devices

Light pen - handheld, pen-shaped device connected by a cable to a computer with special
software that contains a light source to detect the presence or absence of light.

Digital camera and camcorder - devices used to enter a full motion recording into a
computer and store on a hard disc or some other medium.

This marks the end of today's lesson. In the next lesson we'll look at output devices. Until then,
keep up the good work and remember, work not hard, but very smart.

Manual Input Devices


Data is entered or transferred into the computer manually or by hand.

Input Device Application Advantages Disadvantages


Keyboard touch
1. Time Consuming
Key strokes are converted
Manually input text and 1. Inexpensive 2. Speed depends
to bits (computer
commands into the
language) and the item 2. Common means of on user experience.
computer. 3. Repititive use can
displayed on screen. entering text.
cause strain.
Mouse touch
1 Problems with
hand-eye
Issue commands to 1. Commands are
Clicking of mouse buttons coordination.
computer, main given directly to
remits positional 2. Can be confusing
interface between the computer by clicking
information to computer. to shift between
computer and the user. on icon.
mouse and
keyboard.
Joystick touch
1. Joystick
Shaped like the gearshift Used mostly for playing movement is
1. Ideally shaped for
in a car with different games and in virtual sensitive and user
its use.
buttons for commands. environments. has to become
familiar with same.
Touch Pad touch
Small flat rectangular 1. Easily damaged
Issue commands to
device, which like the 1. Fixed position so due to dust or water
computer, main
mouse, remits positional very short finger drops.
interface on laptop
information to the movements required. 2. Too slow if
computers.
computer. playing games.
Touch Screen touch
1. More expensive
1. User friendly than normal
Monitor with a touch Used to communicate
2. Can be used by monitors.
sensitive panel on the information e.g. ATMs,
children & bodily 2. Limited values
screen. restaurants and mails.
challenged. can be entered at a
time.
Scanner light
1. Image quailty
Conversion allows for
Used to capture hardcopy depends on
the import & export of 1. Cheap and easy to
images and create digital hardcopy quality,
files across different install
images. scanner and
applications.
associated software.
Microphone sound
1. Problems
Audio data input, which is Dictate or give identifying
1. Appropriate for
analysed for commands commands directly to homophones.
blind individuals.
and processed. the computer. 2. Problems with
accents.

Input Device Application Advantages Disadvantages


Barcode Reader light
1. Details and order
1. Fast and accurate. of data cannot be
Different groups of bars
Barcodes are groups of 2. Data can be input stored
represent different
bars of differing widths much faster. automatically.
numbers which further
representing different 3. Cheap to produce 2. Price of the
represent different
information on products. as normal paper and product is not
information.
ink can be used. included in the
barcode.
Optical Character
laser
Recognition (OCR)
1. Text accuracy can
Text and graphics are be poor.
Used to input large 1. Speed up the
scanned so it can be 2. Inappropriate for
amounts of text. typing process.
edited. handwritten
documents.
Optical Mark laser
Recognition (OMR)
1. Limit to the
Similar to OCR, but it
number of
relies on the presence or
Used in lotteries and 1. Data input very responses.
absence of precisely
multiple choice papers. quick and exact. 2. Data may be
positioned marks on a
rejected if there are
special form.
inconsistencies.
Magnetic Ink Character
magnetic
Recognition (MICR)
1. Fast and highly 1. Limited
Data is represented as
efficent. applications.
special characters using Used in cheque
2. Not easily forged. 2. Its use is
magnetic ink which is processing.
3. Both human and dependent on the
then converted to text.
machine readable. use of cheques.
Smart Card magnetic
1. Stores financial
Magnetic Strip on a 1. Easily damaged.
transactions.
plastic card containing 2. May be replaced
Used as debit, credit, 2. Transactions are
information about the int he near future by
phone and bus cards fast.
cradholder which is embedded
3. Enables cashless
accessed when swiped. microchips.
travelling.
Musical Instrument
Digital Interface sound
(MIDI)
Used by musicians to 1. Data can be 1. Special software
Used to store vocals
create, manipluate ans arranged in many is needed to convert
and instrumentals or
store sounds into a ways after being music into a musical
combination of the two.
computer. stored. score.
Categories of storage media
Nadine S. Simms, Contributor

Good day, students. In today's lesson, we will be completing last week's topic of storage
and media:

 Magnetic discs (see lesson four)


 Optical discs

 Magnetic tapes

Optical discs

An optical disc is an electronic data-storage medium that can be written to and read using a
low-powered laser beam. It can generally store much more than magnetic media and is a
flat, round, portable metal storage medium (4.75 ins) that is used to store large amounts of
pre-recorded information. A high-powered laser light creates the pits in a single track,
divided into evenly spaced sectors that spiral from the centre of the disc by reflecting light
through the bottom of the disc surface. The reflected light is converted into a series of bits
that the computer can process.

Types of optical discs

 CD-ROM (compact disc - read-only memory)


This allows up to 650Mb of stored data. As a result, it is used in entertainment,
atlases and reference works, training, encyclopaedias, music, culture and film,
education, catalogues, books and magazines.
 CD-R (compact disc recordable) and CD-RW (compact discs rewritable)
Data can be written to both types but can be erased from the CD-RW.

 DVD (digital video disc or digital versatile disc)


This allows the user to store up to 17GB of data, the equivalent of 26 CD-ROMs, and
is popularly used to store full-length feature films.

Magnetic tapes

This is a magnetically coated ribbon of plastic capable of storing large amounts of data and
information at a low cost. Tape storage requires sequential access which refers to reading
and writing data consecutively. Magnetic tapes are used for long-term storage and as a
backup.

Flash drives

Flash drives are data-storage devices integrated with a USB (universal serial bus) interface.
They are generally 7mm in length and weigh less than two ounces, making them the perfect
portable storage device. Storage ranges from 64MB to 64 GB.

NB - Storage devices may also be categorised based on the way in which the information
saved on the device is accessed.
Fig 5.1 Categorisation of storage devices

Fig 5.2 Cross section of a typical disc

IMPORTANT TERMS IN STORAGE


Term Definition
Address A particular space in memory where data or instructions are stored.
Word Amount of data the computer accesses at one time.
Number of bits the processor can interpret and execute at any given
Word Size
time.
Short for binary digit, the smallest unit of data that the computer
Bit
can handle.
Byte A group of eight bits, which represent a single character.
Used to access data/information. Heads are mounted on access arms
Read/Write Head
that are positioned between the plotters.
Sector The name given to the pie shaped section of the disk.
Tracks A concentric circle on the disk used to store data.
A temporary area that holds data in transit from one device to
Buffer
amother.
Cylinders Similar tracks on a platter of disk.
Time taken for the read/write head to access data/information on the
Access Time
disc.
ay, students. Today, we will be learning about primary storage and media.

What is storage?

Storage refers to the holding of data, instructions and information for future use. There are
two types of storage; primary and secondary storage.

Primary storage

Also known as main memory, this term is used to describe internal memory locations that
store data, instructions and information while the computer is 'on'. The two types of primary
storage are RAM (random access memory) and ROM (read only memory).

(See below)

PRIMARY STORAGE
DEFINITION FUNCTIONS VARIATIONS
TYPE
 Stores data
to be
processed.

 Stores
instructions SRAM - (Static RAM)
for faster, more reliable than
processing DRAM; name derived from
Contains temporary data. the fact that it doesn't
or volatile memory
need to be refreshed like
Random access which is lost (erased)
 Stores dynamic RAM.
memory (RAM) whent he computer's
processed
power supply is
data DRAM - (Dynamic RAM)
turned off.
(information popular in PCs, needs to be
) that is refreshed; slower than
waiting to be SRAM.
sent to an
output or
secondary
storage
device.

PROM - (Programmable
 Stores data, ROM) once programmed,
A memory chip that
information cannot be erased.
stores instruction and
or EPROM - (Erasable PROM)
data permanently.
Read only memory instructions erased by exposure to
Contents are non-
(ROM) necessary ultra-violet lights.
volatile (not lost
for the EEPROM - (Electrically
when the computer's
operation of EPROM) erased by
power supply is lost).
the system. exposure to electrical
charge.
Secondary storage

Also known as auxiliary storage, this is memory external to the main body of the computer
(CPU) where programmes and data can be stored for future use. When using secondary
storage, there are two objects involved, the storage device and the storage medium.
Storage devices are the mechanism used to record information to and retrieve items from a
storage medium, while the storage medium is the physical material on which data and
information is kept.

Categories of storage media

 Magnetic discs
 Optical discs

 Magnetic tapes

Magnetic discs

A magnetic disc stores magnetically encoded data in concentric circles or tracks. Tracks are
usually divided into pie-shape sectors. Most magnetic discs are read/write storage media.

Types of magnetic discs

 Hard discs
 Floppy discs

Hard discs

A hard disc usually consists of several inflexible, circular discs called platters on which items
are used electronically. It is the major storage medium of mainframes and minicomputers
and it may be fixed or removable.

Advantages

 They are an inexpensive means for storing data.


 They are non-volatile.

Disadvantages

 Most are not portable.

Floppy discs

A floppy disc is a portable, inexpensive storage medium that consists of a thin, circular,
flexible disc with a plastic coating enclosed in a square plastic shell. It may be single or
double sided and is available in high and low density.

Advantages

 Very popular
 Cheap

 Portable

Disadvantages

 Very small storage capacity


 Affected by heat and electromagnetic fields
Types of computers
Nadine S. Simms, Contributor

Good day, students. Today, we will be learning about the various types of computers.

Categories of Computers

Computers are typically classified into four categories. It should be noted, however, that
today's experts in the field of information technology have computers classified into more
groups. However, the Caribbean Secondary Education Certificate syllabus confines us to
four: microcomputer/personal computer (PC), minicomputer, mainframe and
supercomputer. These classifications are made based on physical size, number of users
simultaneously and the general price at which these computers are sold.

Personal computer

A microcomputer or PC is a small-scale computer usually designed to be fit on a desk and


for one user. It can perform the information processing cycle by itself and usually contains
all the components of a computer (input, output, storage and communications devices).
Microcomputers can be seen all around, as they are used in schools, homes, small and
medium-size businesses.

Characteristics

 One processor, instruction length of 32 bits


 Memory capacity of 2 gigabytes (2x109 bytes)

 Fixed storage capacity of 500 megabytes (500x 106 bytes)

Two types of PCs are the desktop and the laptop.

Minicomputer

A minicomputer is a class of multi-user computers that lies in the middle of the categories of
computers. It is fairly difficult to make a clear-cut distinction between the minicomputer and
the mainframe (see below) and the minicomputer and the PC. The minicomputer is a more
powerful but still compatible version of the PC that facilitates more users, while it is also a
smaller version of the mainframe, running the same applications with fewer users.

Characteristics

 Many processors, instruction length of 64 bits


 Memory capacity of several gigabytes

 Storage capacity of several terabytes

 The minicomputer is used in medium-size businesses.

Mainframe
A mainframe computer is a big, high-priced, powerful computer that can handle hundreds or
thousands of uses concurrently. It contains huge amounts of data, instructions and
information and is mostly used by large businesses in the form of servers in a network
environment. Mainframe computers can be found in banks, high schools, universities,
hospitals and government agencies.

Supercomputer

A supercomputer is the largest, fastest, most expensive and most powerful computer of the
four.

Characteristics

 Capable of processing 135 trillion instructions per second


 Weighs over 100 tons

 Storage capacity of more than 20,000 times the average desktop computer

Supercomputers are used in circumstances where complex mathematical calculations are


used to arrive at a solution to a problem. These circumstances include large-scale
simulations in medicine, aerospace engineering, automotive designing, environmental
occurrences (weather forecasting, global climate change, pollution and earthquakes) and
nuclear energy research.

Factors influencing a computer's power

There are several factors affecting power that must be considered when attempting to
choose a computer to perform a given task or function. These include:

 Speed
 Accuracy

 Storage capacity

 Reliability and consistency


Learning about the computer
Nadine S. Simms, Contributor

Good day students. This is lesson two of our series of information technology lessons.
Today, we will be learning about the computer and its basic components.

What is a computer?

This is an electronic device that operates under the control of instructions stored in its
memory, which can accept data, process this data and give results, with the option to store
them for future use.

Data and information

A computer processes data and outputs information. Data refers to a collection of raw,
unprocessed items, including text, numbers, images, audio, video, etc, that is not useful.
Information refers to processed items, useful to people, which communicate meaning.

The process by which data becomes information is referred to as the information-processing


cycle. This is the series of activities, including input, processing, output and storage. Figure
2.1 illustrates this cycle.

Components of a computer

The computer, as it stands physically, comprises what is referred to as hardware. These are
the electric, electronic and mechanical components of the computer. These can be divided
into various categories which can be seen, along with examples, in Figure 2.2.

System Unit

The system unit is a very necessary component of a computer that doesn't fit comfortably in
the categories listed above. It is a metal case that houses the electronic circuits of the
computer. These circuits are used to process data and, all in all, operate the computer. It
consists of the power supply, internal disk drives, cooling fans and the motherboard or
system board that houses the CPU (central processing unit).

Central Processing

The CPU is also known as the brain of the computer. It is a microprocessor chip responsible
for the processing of data keyed into a computer. The CPU's task is no easy one and, in
order to complete this effectively and efficiently, the CPU has three subunits; arithmetic and
logic unit, control unit and registers.

 Control Unit (CU) - This is the part of the CPU responsible for the fetching and
executing of (carrying out) the programmed instructions used to operate the
computer. It generally controls the transfer of data to and from the CPU. It can also
send a command for data to be transferred from the main memory to the printer.
 Hence, the CU, by sending information to different devices in the system, controls
the flow of data in the computer on the whole.

 Arithmetic and Logic Unit (ALU) - A major part of the CPU, this receives all
instructions containing arithmetic or involved with checking the value of an item of
data. It deals with the processing of these items of data. The ALU is also responsible
for instances where logic, drawing comparisons between items of data, is required.
The ALU has a set of internal locations for storing data for immediate operation.

 Registers - A set of special internal storage locations, found within the ALU, which are
responsible for storing data for immediate operation.
This marks the end of today's lesson. Next, we'll be exploring the various categories of
computers. Until then, keep up the good work and remember to work, not hard, but very
smart.

Components What is it? Examples


Any hardware device which allows
mouse, keyboard,
Input device the user to enter data and
scanner, microphone
instructions into the computer.
Any hardware component that
printer, monitor,
Output device conveys results from the computer
speakers
to the user.
Any component of a computer,
CD, DVD, USB flash
whether internal or external, that
Storage device drive, hard disk,
holds data and information for
memory card
future use.
Any device that facilitates the
Communication device transmission of information modem
between two or more computers.
Figure 2.2 - Components of a computer.

Data Information
(down arrow) (up arrow)
Input Output
Process
(up and down arrows)
Storage
Figure 2.1 - The process from data to information.
Applications of info technology
Nadine S. Simms, Contributor

Good day students, I trust that your studies have been going well. Today we will be starting
our discussion on the applications and implications of information technology.

This is a broad topic which deals with how information technology has been applied
(application) in aspects of our daily life to aid us in accomplishing tasks more accurately and
efficiently. While the implications aspect of the topic deals with the changes in aspects of
our daily lives that arise with the creation of new technology and applied knowledge.

Information technology is applied to several aspects of our lives, some of which include
communication, recreation, research, completing transactions, etc.

In addition to these, information technology has been applied to many once-uncomputerised


skills, while those already computerised have been improved upon. Some such areas
include:

 Banking
 Science and technology

 Education

 Engineering and design

 Manufacturing

 Science and technology

 Law enforcement

 Recreation and entertainment.

We will be exploring how the application of information technology to the areas listed above
has influenced the way operations within the given area are conducted.

Banking

Some of the functions of computers in banking include:

 Processing transactions of customers (e.g. deposits and withdrawals, loans)


 Processing of cheques written by customers

 Electronic fund transfer (the transfer of money using electronic methods)

 Some of the hardware used in banking are:

 Mainframe computer networked with dumb terminals at each employee's work


station

 Line printers that are used for printing reports and customer statements
 Character printers which print transactions in bankbooks

 Automated Teller Machines (ATM)

 Magnet ink character read for reading numbers at the bottom of cheques.

 Some of the software used in banking are:

 Accounting software for managing customers' accounts and financial records of the
bank

 Word-processing software used for preparing correspondence

 Wide Area Network (WAN) software.

Education

The importance of computers in educational institutions is increasing as, at present, they


are being used to teach subjects through the preparation of lessons and the storage of
grades, among other things.

Computers also support learning in the following ways:

 Simulations of laboratory experiments in subjects such as chemistry and physics


 Computer Assisted/Aided Learning (CAL)

 Computer Assisted/Aided Instructions (CAI) - facilitates learning using drills and


practicing principles.

 Research purposes (Internet or encyclopaedia CD ROMs are used.

Some hardware used in education are:

 PCs
 Voice synthesis for teaching people with speech and hearing disability

 Laser and inkjet printers.

Some of the software used in education are:

 Word processors - to prepare lesson plans, letters, tests or assignments


 Spreadsheet software - for calculating students' grades, as well as to display other
statistics such as the maximum and minimum scores

 Database software - to keep track of each student's personal and academic records

 Simulation software - to simulate experiments too dangerous or costly to do in real


life

 Tutorial packages specific to given subjects.

Engineering and design


Gone are the days when architects, designers and engineers would draw using pencils and
paper. With the advent of computers, this task, in addition to those previously listed is done
using the computer primarily using software such as:

 Computer Aided Design (CAD) - for drawing 3D technical drawings.


 Computer Aided Design and Drafting (CADD) - for both 2D and 3D drawings

 Computer Aided Engineering (CAE) - for the simulation of conditions to test the
practicality of a newly designed machinery or implement.

Some of the hardware accompanying the Computer Aided Design and engineering software
are:

 PC connected to a minicomputer or mainframe computer


 High resolution monitors

 Flatbed or drum graphics plotter

 Inkjet or laser printers


Practice programming questions
Nadine S. Simms, Contributor

Good day students I trust that your studies have been going well. Today we will be
practising some programming questions.

Practice the following programming questions then check your answers with those given in
the answer to the practice questions provided.

1. Explain the difference between the following:

a. Logic and syntax error

b. Source and object code

c. Compiling and executing

d. Machine language and assembly language

e. While loop and For loop

2. Write a pseudocode algorithm to read a set of positive integer (terminated by 0) and


print their average as well as the largest of the set.

3. Write a pseudocode algorithm to read a positive integer N followed by N integers. For


these N integers, the algorithm must count and print the number of zero and number of
non-zero values.

4. Write an algorithm to read the names and ages of 10 people and print the name of the
oldest person. Assume that there are no persons of the same age. Data is supplied in the
following form name, age, name, age etc.

5. Write an algorithm to read an integer value for SCORE and print the appropriate grade based
on the following.

SCORE GRADE
85 or more A
Less than 85 but 65 or more B
Less than 65 but 50 or more C
Less than 50 F

6. What is printed by the following algorithm? *(hint: use a trace table to answer).

SUM = 0
N = 20
WHILE N< 30 DO
SUM = SUM = N
PRINT N, SUM
N= N + 3
ENDWHILE

Answers to practice questions

Remember these are pseudo-code. Algorithms are not written in a structured programming
language.

1. a. Logical errors are those errors caused by a mistake in programming instructions. It


causes a program to operate wrong or to produce incorrect results but doesn't stop the
program from working, while syntax errors are those that result from not obeying the rules
of the programming language.

b. A source code is an original program written in a high-level programming language while


an object code is obtained from compiling the source code.

c. Compiling is the process where by a compiler translates the entire source code (all
statements) to its object code before execution takes place, while execution is simply the
process by which the instructions are carried out so as to obtain useful information.

d. Machine language is a programming language consisting of data and instruction as coded


binary digits, zeroes and ones. No translation is necessary for the computer to understand
this language, while the assembly language is another low-level language, however, it uses
mnemonics, which are letter codes to each machine language instruction.

e. The while loop is a type of construct, in which the loop is repeated for an unspecified
number of times until a condition is met while the For loop is a type of looping in which the
loop instructions are repeated for a definite number of times such as 10, 20 or 30 times.

2. Numcount = 0
Sum =0
Largest = 0

Read Num
While Num ? 0 do
Sum = Sum + Num
Numcount = Numcount +1

If Num> Largest
Largest =Num
Endif
Read Num
Endwhile
Print Sum, Largest

3. Read N
Count = 0
Nonzero = 0
Zerocount = 0
FOR Count = 1 to N DO
Read Num
If Num=0
Zero = Zerocount +1
ENDIF
IF Num ? 0
Nonzero = Nonzero + 1
ENDIF
Count = Count +1
ENDFOR
PRINT= Nonzero, Zerocount

4. OLDAGE = 0
For j = 1 to 10
Read NAME, AGE
If AGE> OLDAGE then
OLDAGE = AGE
OLDPERSON= NAME
Endif
Endfor
Print = "The old person is", OLDPERSON

5. Read SCORE
If SCORE >= 85 then
Print = A
Else if SCORE >= 65 then
Print = B
Else if SCORE >= 50 then
Print = C
Else
Print = F
Endif

6.

N SUM Print N P't SUM


20 20 20 20
23 43 23 43
26 69 26 69
29 98 29 98
32

Hence that which is printed for 'N' is N= 20,23,26,29

And that which is printed for 'Sum' is SUM = 20,40,69,98.


Trace tables
Nadine S. Simms, Contributor

Good day students. Today we will be looking at another aspect of programming called trace
tables.

A trace table is one that is completed by tracing the instruction in a given algorithm with
appropriate data to arrive at solutions.

It is most useful in testing one's skills in understanding how the IF, WHILE and FOR
constructs operate, as well as when testing in the debugging stage of creating one's
programmes.

For each algorithm that is being traced, a table is created since it enables better
organisation of data. The table contains columns drawn for each variable used in the
algorithm and enough rows to store the values that are created.

Points to note

 When completing the trace table, we start from the top of the algorithm by writing
the appropriate value in the first vacant cell for the variable, which is currently being
assigned a value.
 When calculating values, a variable can only store one item of data at a given time
and the current value is the value to be entered in the vacant cell.

 When the values of the variables are to be printed, write the answers on your answer
sheet as soon as they are obtained rather than upon completion of the entire table.

 When printing is required within the loop, several values for the same variable may
have to be printed for the same variable, dependent on the number of times the
print instruction was carried out.

 If printing is only required outside a loop, all the values within the loop of the
variable to be printed may not have to be printed.

(See examples below)

Example #1:

Complete the following Trace Table:


X=1
Y=2
Z=3
While Z<45DO
X = X+Y
Y = Y+X
Z = Z+Y
ENDWHILE
Solution #1:

Step 1 Enter the variable int he top row and insert the initial value for each the variable in the
second.

X Y Z
1 2 3

Step 2 Always use the most recent value

X Y Z
1 2 3
3 5 8

Step 3 We stop here because Z is now greater than 45.

X Y Z
1 2 3
3 5 6
6 11 17
17 28 45
45 73 118

Example #2

What is printed in the following algorithm?


M=1
FOR N = 1TO 5 DO
M = M+2
ENDFOR
Print M,N.

Solution #2

M N
1 1
3 2
5 3
7 4
9 5
Therefore that which is printed is:
M= 9, N=5
N.B. FOR is a loop statement, hence we have to repeeat the instructions between
the FOR and ENDFOR five times.

Example #3

What is printed in the following algorithm?

A=1
B=3
WHILE B< 29 DO
A = A*B
B=B+A
Print A,B
B=B+1
ENDWHILE
Print B

Solution #3

A B Print A Print B
1 3 3 6
3 6 21 28
21 7 29
28

29

Hence that which is printed is:


A = 3, 21
B = 6,28,29
Answers
#1. 1, 2, 3,4,5.
#2.
f g j h Print h
1 1 1 2 2
1 2 2 3 3
2 3 3 5 5
3 5
h = 2 f=3, 5 g=3, 5

This is the end of this lesson. In the next lesson, we will be looking at some past
programming questions. See you next week!
Creating and using the loop statement
Nadine S. Simms, Contributor

Good day, students, I trust that your studies have been going well. In today's lesson, we
will be completing the topic, programming.

In order to arrive at the solution to some problems, it may be required that some of the
instructions be performed more than once.

This will be necessary if the same activity is to be done more than once, for e.g., when
calculating the gross income of a number of employees.

In the named example, each employee's gross income is calculated using the same method,
thus, the same instructions that are used for the first employee can be repeated for all other
employees. The instructions that are repeated are called loops.

There are two different types of loops:

 The while loop/construct


 The for loop/construct

The while construct

In this construct, the loop is repeated for an unspecified number of times such that the user
of the programme has to signal the computer when to stop. The computer can also be
programmed so that when a certain condition is met, the repetition stops. It usually takes
the form:

An initial value for the condition


WHILE [condition] DO
[Instructions which are to be repeated]
ENDWHILE

The initial value may be a read variable or a value assigned to the variable, for e.g.: READ
NUM or NUM =1

This initial value is important as it enables comparison for the condition to be made when
the WHILE instruction is executed for the first time.

The condition is made up of the variable storing the initial value and is called the loop
variable, a rational operator >, <, = etc and a termination constant, also known as the
dummy value. The dummy value is not real for the problem being solved; for example, 999
may be the termination value of the entry of students' age in a class, as the age of a
student 999 is not real.

The while statement ought to be interpreted as follows:


Repeat the instructions that fall between WHILE and ENDWHILE, as long as the condition is
true. When the condition becomes false, the repetition ceases and any instruction(s)
following the ENDWHILE is (are) then executed.

NB: The instructions before the WHILE construct are carried out once. Those written
between the WHILE and ENDWHILE may be repeated and those written after the ENDWHILE
are done once after the loop is terminated.

Important within the WHILE-ENDWHILE when using the WHILE construct is an instruction
that changes the value of the loop variable. It allows for termination of the loop, otherwise,
the instructions in the loop would be repeated forever.

Systems for developing an algorithm using the WHILE construct

The algorithm is written based on the fact that a WHILE statement generally follows a read
statement and a read statement generally precedes the ENDWHILE statement.

Example: Write an algorithm to calculate and print the average age of three students
terminated by 999

Answer

Read A, B, C

WHILE A<> 999 DO

SUM = A+B+C

AVERAGE = SUM/3

PRINT = 'Average', AVERAGE

READ A, B, C

ENDWHILE

Steps used to obtain that answer:

1. Write the read instruction

2. Place a WHILE statement immediately following the READ statement and set the
condition for the WHILE statement based on the dummy value given

3. Write instructions that are to be repeated

4. Close the loop with the ENDWHILE statement (ensure a READ statement is placed just
before the ENDWHILE statement)

5. Write remaining statements not to be repeated (for this example, there is none)
The for construct

This is the type of looping in which the loop instructions are repeated for a definite number
of times such as 10, 20 or 30 times.

It usually takes the form:

FOR [Variable] = [beginning] TO [ending]


STEP [Increment] DO
[Instruction (s) which is/are to be repeated]
ENDFOR

'FOR' marks the beginning and 'ENDFOR' the end of the loop. The loop variable is used to
count the number of times the loop is executed. The step clause dictates by how much the
loop must be increased or decreased each time the loop is executed.

Systems for developing an algorithm using the FOR construct

Example: Write an algorithm to calculate and print the average test score for each student
in an IT class of 30. Each student was given three tests.

Answer

For S= 1 TO 30 DO

Read A, B, C

SUM= A+B+C

AVERAGE= SUM/3

Print = 'Average', AVERGE

ENDFOR

Steps

1. Write the FOR instruction

2. Write the READ instruction

3. Write the instructions to be repeated

4. Close the loop with ENDFOR statement

5. Write the remaining instructions that are not to be repeated (for this example, there is
none)
Programming (continued)
Nadine S. Simms, Contributor

Good day, students. I trust that your studies have been going well. In today's lesson, we
will be continuing with the topic, programming.

The assignment statement

The assignment statement is used to store a value in a variable after the operation (i.e.
+,-,*, or /) has been performed. The syntax of the assignment statement is as follows:

VARIABLE = Expression (i.e. what is to be calculated)

Examples of assignment statements are:

1. NUM1 = 5 (i.e. Store the value 5 in the variable NUM1)

2. SUM = NUM1 + 50 (i.e. Add 50 to the value stored in NUM1, then store the total in the
variable name sum)

3. Product = NUM1*SUM(i.e. Multiply the content of NUM1 by the content of SUM)

Examples of pseudocode question

Pseudocode 1

Write an assignment where two numbers 20 and 30 are added.

Solution

SUM =20 + 30 (i.e. An assignment statement that adds two numbers 20 and 30 and stores
the results in a variable name SUM)

Pseudocode 2

Write a pseudocode to read two numbers and find their product.

Solution

Read NUM1, NUM2 (i.e. Input statement that accepts a value and stores the result in
variable name NUM1 after which NUM2 is accepted and stored in variable name NUM2)

PRODUCT = NUM1 + NUM2 (i.e. An assignment statement that multiplies the contents of
NUM1 by the contents of NUM2 and stores the result in the variable PRODUCT)
The question above could also be worded:

 Write a pseudocode that prompts the user to enter two numbers, then find their
sum.
 OR

 Write a pseudocode that accepts two numbers and find their sum.

The output statement

The output statement is used to show the value of the variable or a constant. This is usually
achieved by using a screen or printer.

The input statement most often used by pseudocode developers is:

PRINT = VARIABLE

Examples of output statement

Outputting the value of the pseudocode 1 above

PRINT = SUM

For Pseudocode 2, the output statement would have been:

PRINT = PRODUCT

N.B. The content of the variable is printed or outputted, and not the name of the
variable. For example, the value of the sum which would have been 50 would have
been outputted, and not the word SUM.

Practice questions

1. Write an instruction to read a name and output it.

2. Write a pseudocode that prompts the user to enter two numbers, finding the sum and
outputting the value obtained.

Answers to these questions will be given next week.

We have come to the end of this lesson. In the next, we will be looking at the condition
statement. See you next week and remember, work not hard, but very smart.
Programming
Nadine S. Simms, Contributor

Good day, students. I trust that your studies have been going well. In today's lesson, we
will be continuing with the topic, programming.

The input statement

The input statement is used to fetch data from some external source and store the data in a
variable. The data stored in the variable can then be manipulated by the pseudocode.

Examples of input statement used by pseudocode developers are:

 Read NUM1
 Input NUM1

 Fetch NUM1

 Get NUM1

All the statements above perform the same function in a pseudocode; they instruct the
computer to request input and to store the request input in the variable, NUM1. For our
lessons, we will use the first stated example for the input statement, that is, read variable
name:

Where the programmer supplies the name of the variable.

Pseudocode example one

Write a pseudocode to read two numbers into variable A and B.

Solution
Read A
Read B

Pseudocode example two

Write a pseudocode to read the name and score for three persons.

For this question, we need to store six pieces of data, three names and three test grades,
respectively. Hence, six variables are needed. Our variable will be called:
NAME1, NAME2, NAME3, GRADE1, GRADE2 and GRADE3.

The solution to this problem could be written in any one of three forms shown in Table 1.

The same function is performed by all three psuedocodes. However, solution 1 accepts the
name of all the persons followed immediately by their grades; in solution 2, all the names
then all the grades are accepted; while solution 3 is inputted just as solution 2, except that
the input statements are written in the same line and each is separated by a comma.

If we were to carry out the instruction above using the following data:

Bill 73
Sally 85
Mark 60

For solution 1, the data would be entered in the order above, while for solution 2, the data
would be entered in the following order:

Bill

Sally

Mark

73

85

60

Solution 3 would be written as shown below:

Bill, Sally, Mark

73 , 85 , 60

After the instructions are carried out, the statement of our variables could be illustrated as
shown in Table 2.

Remember that a variable is a storage location whose value is subject to change. If we


carried out the instructions using the following data:

Candy 55

Joseph 90

Andy 79

Then the new state of the variable will be as shown in Table 3.


Table 1
SOLUTION 1 SOLUTION 2 SOLUTION3
Read NAME1 Read NAME1 Read NAME1, NAME2, NAME3
Read GRADE1 Read NAME2 Read GRADE1, GRADE2, GRADE3
Read NAME2 Read NAME3
Read GRADE2 Read GRADE1
Read NAME3 Read GRADE2
Read GRADE3 Read GRADE3
Table 2
NAME1 GRADE1 NAME2 GRADE2 NAME3 GRADE3
Bill 73 Sally 85 Mark 60
Table 3
NAME1 GRADE1 NAME2 GRADE2 NAME3 GRADE3
Candy 55 Joseph 90 Andy 79

We have come to the end of this lesson. In the next lesson, we will be looking at the
assignment statement. See you next week and remember, work not hard, but very smart.
Understanding programming concepts
Nadine S. Simms, Contributor

Good day, students, I trust that your studies have been going well. In today's lesson, we
will be commencing a new topic, programming, which I must say accounts for 30% of your
marks for the CXC Technical Proficiency Theory Examination. An excellent grasp of this topic
is important for passing this exam.

PROGRAMMING CONCEPTS

Programme vs. Programming language

A programme is a sequence of instructions used by the computer to solve a specific


problem. The programme is written (coded) in a programming language which is a set of
words, symbols and codes that enable the programmer to communicate the solution
algorithm to the computer. There are many programming languages. Each one has its own
vocabulary and set of rules called syntax, which governs how words and symbols are
combined to form instruction.

Programming language falls into four broad categories namely:

1. Machine languages

2. Assembly languages

3. High-level languages

4. Natural languages

Machine Language

This is the lowest level of programming language; it consists of a string of ones and zeroes
called binary digits. It is the only language that needs no interpretation for the computer to
understand.

Assembly Language

This is another low-level language; however, it uses mnemonics (letter codes to each
machine language instruction). A special programmer, called an assembler, converts each of
the mnemonic code and translates it into its machine language equivalent.

High-Level Languages

These are languages that closely resemble human language and need to first be converted
to machine language before the computer can carry out the instructions.

Natural Language
These are the languages normally spoken by humans which make it comprehensible to
humans. However, it is very difficult for computers to understand it due to vastness of
vocabulary as the languages vary.

Source Codes and Object Codes, the difference between the two

Source codes are programmes written in a particular programming language which may be
converted to machine language so that the computer can understand it, while object codes
are machine codes which have been converted to machine language by the compiler.

Compilers

A compiler is a computer programme which translates source codes to machine language. It


does so first by converting the codes of the high-level language and storing it as object
codes. However, it is done before run time which makes the execution time faster than that
of an interpreter.

Figure 10.1 A diagrammatic outline of the compilation process.

Figure 10.1 A diagram showing the run-time of a compiled program.

Interpreters

These are a set of codes or a programme that are used by some programming language to
translate source codes to machine language. They do so while the programme is being
executed and translated. Codes are not saved, therefore, making it necessary for translation
to take place each time the programme is executed.

Figure 10.1 A diagram showing the run-time flow of an interpreted programme.


The Internet
Nadine S. Simms, Contributor

Good day, students. I trust that your studies have been going well. In today's lesson, we
will be looking at the topic in our syllabus called Internet.

Checking email, chatting with friends, downloading files, searching for information,
advertising, listening to music, conducting business transactions and viewing video clips are
some of the many ways we use the world's largest network, the Internet, on a daily basis.
However, to carryout the activities mentioned, we would first have to be connected to the
Internet.

How do we become connected to the Internet?

To do so, we need to first become apart of the network it comprises. The most common way
of doing this is through the local Internet service providers (ISP), companies with direct
connection to the Internet that grant subscribers access, e.g., Cable and Wireless or Flow.
In addition to specialised software, subscribers connect using one of two things:

 Dial-up connection, broadband cable or


 Digital subscriber line (DSL)

Definition of words and phrases commonly associated with the Internet

World Wide Web (www) - is just one of the components of the Internet consisting of a
collection of text and media documents called web pages.

Web pages - are a group of one or more related electronic documents. Multiple pages are
grouped to create a company's, individual's or group's website. Web pages are usually
encoded in a special language called Hypertext Mark-up Language (HTML) that allows one
web page to provide links to several others.

Website - is simply a group of related web pages on the same server.

Web browsers - are special software that allow users to view web pages, e.g., Netscape,
Internet Explorer and Mozilla Firefox.

Search engine - is the name given to a software or website that allows a user to find
information quickly by typing in key words or phrases.

Hypertext Transfer Protocol (HTTP) - governs the transmission of web pages over the
Internet.

File Transfer Protocol (FTP) - this is the set of rules used to govern the sending and
receiving of files on the Internet. It enables us to find an electronic file stored on the
computer somewhere else and download it. It also enables us to upload (add information to
the web). These files are stored on what are termed FTP sites and are maintained by
universities, government agencies and large organisations.
Uniform Resource Locator (URL) - this is a unique address attached to each web page or
Internet file, e.g. www.Informationtechnology.com.

Features of the Internet

Electronic mail - permits the transmission of documents from one terminal or computer of
another via the Internet. The mail is stored in the recipient's mail box' and can be retrieved
at the recipient's convenience using a password. The concept is similar to that of a postal
system.

Advantages of email

 Messages are sent instantly, thus increasing retrieval time.


 It is very convenient.

 Recipient can store, print, erase, edit or forward the message.

Disadvantages of email

 Increases the possibility of computer viruses being spread.


 We cannot send email to people who do not have an email account.

Bulletin board - similar to the normal bulletin board, it is a centralised computerised


location, to which remote computers can connect. Once connected, a user may upload a file
or download those posted by others.

News group - this may be one of several online discussion groups covering a particular
subject or interest.

Internet Relay Chat (IRC) - this feature allows two or more persons from anywhere in
the world to participate in live discussions. Instant messaging programmes include ICQ,
MSN messenger and Yahoo messenger.

Telnet - this is one of the ways that a person can access a remote computer over a network
such as the Internet. It is often used by individuals or companies that seek to limit the
privileges of people who are logging onto their computer(s) via telnet.

Intranet - this is a type of network belonging to and is used exclusively by a particular


company.
Data communication
Nadine S. Simms, Contributor

Good day, students. I trust that your studies have been going well. In today's lesson, we
will learn about data communication.

Data Communication

As globalisation increases, the need for countries, companies and institutions to get fast and
up-to-date information to maintain their success and competitiveness also increases. To
achieve this goal, an efficient data communication system must exist.

Data communication, in its broadest sense, is described as the transmission of data from
one location to another for direct use or for further processing. Its system is made up of
hardware, software and communication facilities. In order to carry data from one location to
another, data transmission channels are needed.

Data Transmission

Data transmission channels carrying data from one location to another can be classified
according to bandwidth, which measures the volume of data that can be transmitted at a
given time. The wider the bandwidth, the greater the data that it can transmit. There are
three classes of bandwidths, namely:

Narrow-band - This channel can transmit data at slow speeds of between 10-30 characters
per second (30 cps) and is made use of in the telegram system.

Voice-band - this channel can transmit data at the rate of 1000 to 8000 cps. A telephone
line is voice-band.

NB - A standard telephone transmits only in analogue signal, whereas signals emitted from
a computer are in digital form. So that signals from a computer can be transmitted over the
telephone line, a device called modem (modulator/ demodulator) is used to convert the
digital signals from the computer to analogue and to digital when it needs to be reconverted
after transmission has been completed.

Broad-band - This channel can transmit large volumes of data at very high speeds; over
100 000 cps. Coaxial cables, fibre optic cables, microwave links and communication
satellites are commonly used to provide these channels.
Apart from the amount of data being transmitted via transmission lines, the direction in
which the data is flowing through the lines can also be used to classify them.

Simplex line - Allows data to flow in one direction only, ie, one may send or receive data,
but not at the same time. This transmission style is employed in the beeper technology.

Half-duplex line - Enables one to alternate the action being carried out. At one point, one
may be able to send data but not receive it and at another, receive it but not send. This
style is used in the walkie-talkie technology.
Full-duplex line - Enables user to both send an receive data at the same time, eg,
telephone

Network

In order for data to be transmitted from one computer to another, the computer must be
linked via thus creating a network. Computer networks fall in one of the following groups:

 Local area network (LAN)


 Wide area network (WAN)

 The Internet

 Intranets

 Local area network (LAN)

A LAN consists of micro-computers interconnected over a small geographic region, such as


in a building, department or school, where they may share peripheral devices (printers,
scanners, etc) and information, and communicate with one another on the network. A
server controls the sharing of resources within the network.

Advantages

Software and data files can be shared by many users. It is usually cheaper to buy one copy
of a software application and pay a licence fee for several machines, than to buy individual
packages for each computer:

 Increased productivity as network users can work on a single document


simultaneously.
 Facilitates faster communication via email.

Disadvantages

 Initial set-up cost can be very high.


 There is an increased risk of data corruption.

 There is greater risk from virus, since they are spread much more easily between
computers, forming part of LAN.

Wide Area Network (WAN)

A WAN consists of microcomputers interconnected over a large geographic region, such as


in a city, a parish, or a country. Information can be transmitted using special high-speed
telephone lines, microwave links, satellite links, or a combination of all three.

In essence, it uses broad-band communication. WANs are particularly useful in universities


and research centres so that information can be shared, and by large, multinational co-
operations, such as banks. WANs share the same advantages and disadvantages as do LAN
or any other network for that matter.
Software
Nadine S. Simms, Contributor

Good day, students. I trust that your studies have been going well. In today's lesson, we
will be learning about software - what it is, along with its categories and functions.

Software

What exactly is software?

Software is simply computer programmes; instructions which cause the hardware (printers,
scanners, drives, etc.) to do work. Software as a whole can be divided into a number of
categories based on the types of work done by programmes. The primary categories of
software are:

 System software
 Application software

System software

The system software is the set of programmes which controls the working of the computer.
It is responsible for:

Storing the information used in the starting of the computer (boot-up process).

Controlling the hardware.

Preparing the computer to carry out useful work.

System programmes do not solve end-user problems. Rather, they enable users to make
efficient use of the computing facilities for solving their problems.

These programmes manage the resources of a computer system, automate its operation,
make the writing easier, and does the testing and debugging of users' programmes. A type
of system software is the operating system.

Operating system

An operating system may be seen as a suite of programmes that has taken many functions
once performed by human operators.

It can be seen from what is said that the operating system controls the way software uses
hardware. This control ensures that the computer not only operates in the way intended by the
user, but does so in a systematic, reliable and efficient manner. This 'view' of the operating
system is shown below.
Application software

Application software are programmes that address the tasks you want to carry out.
Application software include:

 Word processing - used in the preparation of typed documents which may consist
of words, symbols and/or pictures or a combination of these elements.
 Spread sheet - is a simulated account worksheet, comprising rows and columns in
which numeric data can be entered. There is also a set of hidden formulae capable of
performing calculations on the entered data.

 Database package - is used to systematically arrange collected data in the


computer so that it can easily be retrieved or manipulated.

Other categorisations of software

Software can also be classified as:

 General purpose software - Programmes which are designed to cover a single but
broad application scope. Prime examples of this are programmes such as Microsoft
Word, spreadsheet operations or database management.

Advantages

 Many persons use it.


 Help is readily available.

 Updates are readily available.

Disadvantage

 Does not meet the specific needs of the individual.


 Specialised software packages - Programmes designed to give the user a range of
different tools for assistance in completing a specific or narrow kind of task, rather
than for a broad application area. An example of this could be a programme,
especially designed for preparing and printing DVD labels.

Advantage

 Makes work easier and more efficient for its users.

Disadvantage

 Does not meet the general needs of end users.


 Custom-written software - Programmes which have been created specifically to
meet the needs of a particular individual or company. It is very similar to you going
to a tailor for him to make a suit to meet your fashion needs.

Advantages

 You get exactly what you want.


 Your software runs faster since the code is optimised to serve your specific purposes
only.

 You are in more control of revisions made to the software.

Disadvantage

 Its development is time consuming.


 Its development is very costly to the individual or company.

 Special training is necessary which can also be expensive and time consuming.

 Customisation of general purpose software - Imagine having an article of clothing


which does not quite suit you. You would take this garment to the tailor and ask him
to modify it.

 Customisation of general purpose software is just like this; where a general purpose
software package is changed so that it satisfies the needs of a specific user or
company.

Advantages

 Meets the specific needs of the user.


 More cost effective than designing custom- written software.

Disadvantages

 Updates will not be as easily obtainable as with the general-purpose software.


Binary code (cont'd)
Nadine S. Simms, Contributor

Good day students. I trust that your studies have been going well. In today's lesson, we will be
continuing the topic of data representation.

Binary Coded Decimal (BCD)

The digits 0-9 can be represented in binary. If this method of coding is used on each digit of a
decimal number separately, the binary coded produced is called BCD. BCD is a very convenient
code for converting to and from base 10.

Digit 8 4 2 1
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
Table 7.1 showing binary representation of numbers 0-9.

There is a pattern! Can you figure it out? N.B. Each digit is represented by 4

Examples:

Find the BCD for the following:

1. 82

From table eight in BCD is 1000 and two is 0010, therefore the answer should be: 1000
0010

2. 104

From the table one in BCD is 0001, zero is 0000 and four is 0100 therefore, the answer
should be: 0001 0000 0100.

Negative BCD
To represent a negative number in BCD, 1011 is added just before the number and 1010 is
added for a positive number. Therefore, answer for example one should read: 1010 1000
0010, but if it were, negative, it would have read: 1011 1000 0010.

Coding Schemes

The combination of zeros and ones used to represent characters are defined by patterns
called a coding scheme. Using one type of coding scheme, the number one is represented
as 00110001. Two popular coding schemes are American Standard Code for
Information Interchange (ASCII) and Extended Binary Coded Decimal Interchange
Code (EBCDIC).

ASCII is used mainly on personal and mini computers, while EBCDIC is used primarily on
main- frame computers. (See table below)

ASCII SYMBOL EBCDIC


00110000 0 11110000
00110001 1 11110001
00110010 2 11110010
00110011 3 11110011
00110000 4 11110100
00110001 5 11110101
00110010 6 11110110
00110011 7 11110111
00110000 8 11111000
00110001 9 11000001
01000001 A 11000001
01000010 B 11000010
01000011 C 11000011
01000100 D 11000100
01000101 E 11000101
01000110 F 11000110
01000111 G 11000111
01001000 H 11001000
01001001 I 11001001
01001010 J 11010001
01001011 K 11010010

Table 7.1 Showing ASCII and EBCDIC representation of numbers and some letters
of the alphabet.

Parity

One bit in a byte or word is sometimes used for checking purposes. It is called a Parity Bit.

There are two types of parity:

i) Odd parity
ii) Even parity

Even parity

If a particular computer uses even parity, the parity bit is represented as a zero or one, so
that there is an even number of ones in the whole byte or word.

Odd Parity

For odd parity, there must be an odd number of ones, hence, the parity bit is represented
as a zero or one, so that an odd number of ones results in the whole byte or word.

Examples:

1. Using an even parity on an eight-bit byte:

1 1001001

Parity bit underlined.


N.B. The parity bit contains a one to make up an even number of ones.

2. Using an odd even parity on a 16-bit byte:

0 110111101101100

Parity bit underlined


N.B. Because the ones are already even - the parity bit is expressed as a zero.

When an even parity, word or byte is copied from one computer to another, or from one
part of the computer to another, the number of ones in the word or byte are checked. If
there is no longer an even number of ones, then a bit has been copied wrongly. Note that
the parity bit does not affect the value being stored or transmitted. It just acts as a check to
see that the bit value does not carry an error. The check is similar for an odd parity.

BCD, coding schemes and parity can be difficult, so re-read the previous notes as often as
needed. When you think you have got a good grasp of the concepts, try answering the
following questions:

Questions

1) Find the BCD representation of the following:

a) 82

b) 104

2) (a) Explain the difference between odd parity and even parity.

(b) The ASCII representation for the letter 'D' is 1000100:


(i) What is the ASCII representation of the letter 'C'? (Hint: C is one less than D)

(ii) What is the ASCII representation for the letter 'G'?

After having tried them for yourself, but not before, check your answers with the ones at the end
of this lesson.

ANSWERS

1). 1) a. 1000 00102

b.00010 0000 01002

2). (a) With odd parity there is an odd number of ones while
with even parity, there is an even number of ones.

(b) (i) 1000011

(c) (ii) 1000111


Data representation
Representing binary as negative
numbers
Nadine S. Simms, Contributor

Good day students, I trust your studies have been


going well. In today's lesson we will be continuing the
topic of data representation with the focus being on
representing binary as negative numbers.

Students draw designs during their clothing and


representing binary as negative numbers
textile class at Ascot High School last year. -
Anthony Minott/Freelance Photographer
The three most common ways of coding negative
numbers on computers are as follows:

Sign and magnitude

One's complement

Two's complement

Sign and Magnitude

In this coding, one bit represents the sign and the other bit represents the magnitude of the
number. The convention for the sign bit is that the number one (1) represents negative and
the number zero (0) represents positive.

Examples:

Find the sign and magnitude representation of the following numbers:

1. nine

To convert this number to sign and magnitude one must first change the number into
binary (discussed in lesson #12).

910= 10012

Because the number is positive, the sign is represented as zero (0).

The answer is therefore written:

9 = 0(sign): 1001(magnitude)

2. -89
Changing the positive number into binary

8910 = 10110012

Because the number is negative, the sign is represented as one (1).

Therefore the answer is written: -89 = 1(sign): 10110012(magnitude)

one's and two's complement

The main reason for using two's complement and one's complement for the negative
numbers is that they enable subtraction to be performed through a modified form of
addition and thereby simplifies the processing circuit in the chips which do arithmetic in the
computer.

One's complement

In finding one's complement the bits are flipped (i.e. 0 replaces 1 and vice versa)

Example:

1). 1101102 when flipped we get: 0010012.

Two's Complement

The two's complement is found by flipping the bits (as in one's complement) and then
adding one to the result.

Examples:

1). 110011012 = 0010012. (One's complement)

+1
00100112 (Two's Complement)

2). Calculate six minus three (6-3) using twos complement.

Steps to take in answering this question:

1. Convert 6 to binary = 0110

2. Convert 3 to binary = 0011The two's complement of (3) is therefore 1100 + 1 =


1101 same as (-3)

3. Add the numbers six (6) and negative three (-3):

0110 + 1101 = 100112

The number needs to be represented using 4 bits therefore the answer is written: 0011
This topic can be a bit difficult, so re-read the above notes as often as needed. When you
think you have a good grasp of the concept try answering the following questions:

Questions:

1).Find the sign and magnitude representation of the following:

a) 45

b) -96

2). Find the two's complement of the following:

a) 1001001

b) -48

3). Calculate the following using two's complement:

a) 7-6

b) 8-5

After having tried them for yourself, but not before, check your answers with the ones at the end
of this lesson.

ANSWERS

1) a. 0:1011012

2) a. 01101112

3).a.00012

b.0100002 b.1: 11000002 b.0011

También podría gustarte