CSC 113 Lecture Materials
CSC 113 Lecture Materials
Using personal computers as effective problem solving tools for the present and the future
d. Computer Science is a branch of science that deals with the theory of computation or the
design of computers. It is the study of computers, their design, and their uses for
computation, data processing and systems control, including design and development of
computer hardware and software, and programming. The field encompasses theory,
mathematical activities such as design and analysis of algorithms, performance studies of
systems and their components, and estimation of reliability and availability of systems by
probabilistic techniques. Because computer systems are often too large and complicated
for failure or success of a design to be predicted without testing, experimentation is built
into the development cycle.
f. Computer is the science that deals with the theory and methods of processing information
in digital computer hardware and software, and the applications of computers.
h. Computer science is a discipline that involves the understanding and design of computers
and computational processes. In its most general form it is concerned with the
understanding of information transfer and transformation. Particular interest is placed on
making processes efficient and endowing them with some form of intelligence. The
discipline ranges from theoretical studies of algorithms to practical problems of
implementation in terms of computational hardware and software.
Computer science is a discipline that spans theory and practice. It requires thinking both in
abstract terms and in concrete terms. The practical side of computing can be seen everywhere.
Nowadays, practically everyone is a computer user, and many people are even computer
programmers. Getting computers to do what you want them to do requires intensive hands-on
experience. But computer science can be seen on a higher level, as a science of problem solving.
i. Computer scientists must be adept at modeling and analyzing problems. They must also
be able to design solutions and verify that they are correct. Problem solving requires
precision, creativity, and careful reasoning.
ii. Computer scientists often become proficient in other subjects since computer science also
has strong connections to other disciplines. Many problems in science, engineering,
health care, business, and other areas can be solved effectively with computers, but
finding a solution requires both computer science expertise and knowledge of the
particular application domain.
iv. A computer scientist must have a firm foundation in the crucial areas of the field and will
most likely have an in-depth knowledge in one or more of the other areas of the
discipline, depending upon the person's particular area of practice.
v. A well-educated computer scientist should be able to apply the fundamental concepts and
techniques of computation, algorithms, and computer design to a specific design problem.
The work includes detailing of specifications, analysis of the problem, and provides a design that
functions as desired, has satisfactory performance, is reliable and maintainable, and meets
desired cost criteria.
Computer science has a wide range of specialties. These include computer architecture, software
systems, graphics, artificial intelligence, computational science, algorithms and data structures,
programming methodology and languages, and software engineering. Drawing from a common
core of computer science knowledge, each specialty area focuses on particular challenges. Other
areas include software engineering, artificial intelligence, computer networking and
communication, database systems, parallel computation, distributed computation, computer-
human interaction, computer graphics, operating systems, and numerical and symbolic
computation.
i. Operating Systems: concerned with the development and structure of complex programs
which facilitate man-machine communications.
ii. Computational Science: the analysis of numerical methods for solving mathematical
problems with a computer.
iii. Programming Languages: the study of the design and properties of languages by which
humans communicate with computers.
iv. Digital Logic & Computer Architecture: the study and use of mathematical logic to
design electronic circuits.
v. Intelligent Systems: concerned with means by which computers may perform tasks which
might be characterized as "intelligent" if performed by humans.
vi. Automata Theory: an abstract study of computers and their capabilities.
vii. Information Storage and Retrieval: the study of methods for storing a vast amount of data
in a computer and methods for searching and retrieving this data.
viii. Software Engineering: the study of tools and techniques for software design,
development, testing and maintenance.
ix. Database Systems: A database is an organized collection of data which typically model
aspects of reality in a way that supports processes requiring information. Database
management systems are computer software that interacts with user, other applications,
and the database itself to capture and analyze data.
x. Network & Data Communications: Network systems and data communications analyst
plan, design, build, maintain, and test networks and other data communication systems.
The principal focus is to make computers and other electronic device to share data, files
and other computing resources.
xi. Artificial Intelligence & Experts Systems: The study of designing and developing
computer system that emulates the decision making ability of human experts.
xii. Discrete Mathematics: the study of mathematical structures that is fundamentally discrete
rather than continuous. The study focus on combinatorics, graph theory, theory of
computation, and number theory: congruence and recurrence relations.
One to view or understand any science is to study the methods used within that science. In some
sense these methods are similar in many sciences, but they can take on different characteristics in
each discipline. Four important methods used in the study of computer science are:
1. Computer science has always been a progressive field. The first programmer, Ada
Lovelace, was female.
2. About the time I was busy being born, they had just invented the modern hard drive
design. Today, something about half the size of a bar of soap can hold 500 megabytes of
data. And the really expensive drives can put at least 100 megabytes of data on a drive
platter the size of a half dollar. (And there was a point a 10 megabyte harddrive was the
size of a briefcase, and they thought you'd never need to store more than 10 megs. Gee,
they obviously didn't have Tie Fighter back then.)
3. For all of you getting so very excited about the new "Information Superhighway" (and if
I hear that one more time, I'm going to scream): It's already here, you're just now finding
The history of computer development is often referred to in reference to the different generations
of computing devices. Each of the five generations of computers is characterized by a major
technological development that fundamentally changed the way computers operate, resulting in
increasingly smaller, cheaper, more powerful and more efficient and reliable computing devices.
In this section, you'll learn about each of the five generations of computers and the technology
developments that have led to the current devices that we use today. Our journey starts in 1940
with vacuum tube circuitry and goes to the present day -- and beyond -- with artificial
intelligence.
First generation computers relied on machine language, the lowest-level programming language
understood by computers, to perform operations, and they could only solve one problem at a
time. Input was based on punched cards and paper tape, and output was displayed on printouts.
The UNIVAC and ENIAC computers are examples of first-generation computing devices. The
UNIVAC was the first commercial computer delivered to a business client, the U.S. Census
Bureau in 1951
The first computers of this generation were developed for the atomic energy industry.
Instead of punched cards and printouts, users interacted with third generation computers through
keyboards and monitors and interfaced with an operating system, which allowed the device to
run many different applications at one time with a central program that monitored the memory.
Computers for the first time became accessible to a mass audience because they were smaller
and cheaper than their predecessors.
CSC 113: Computer For Arts, Social Science And Management P a g e |9
Fourth Generation (1971-Present) Microprocessors
The microprocessor brought the fourth generation of computers, as thousands of integrated
circuits were built onto a single silicon chip. What in the first generation filled an entire room
could now fit in the palm of the hand. The Intel 4004 chip, developed in 1971, located all the
components of the computer—from the central processing unit and memory to input/output
controls—on a single chip.
In 1981 IBM introduced its first computer for the home user, and in 1984 Apple introduced the
Macintosh. Microprocessors also moved out of the realm of desktop computers and into many
areas of life as more and more everyday products began to use microprocessors.
As these small computers became more powerful, they could be linked together to form
networks, which eventually led to the development of the Internet. Fourth generation computers
also saw the development of GUIs, the mouse and handheld devices.
A computer is a device that accepts data and manipulates it for some result based on a
program or sequence of instructions on how the data is to be processed.
1. Speed: - Computer can work very fast and requires only few seconds to complete
calculations that will take hours to complete by humans. Computer can perform millions
CSC 113: Computer For Arts, Social Science And Management P a g e |10
(1,000,000) of instructions and even more per second. Thus, the processing speed of
computers is in the range of millions to billions of instructions per second.
For example, it may take you about three minutes to find the location of a book in the
library by searching the index cards. However, if you use a computerised library system
to search the book's location, it may only take you about a few seconds, depending on
how fast you can type. Normally, the computer only takes less than a second to process
your request.
2. Accuracy: - The degree of accuracy of computer is very high and every calculation is
performed with the same accuracy. The accuracy level is determined on the basis of
design of computer. The errors in computer are due to human and inaccurate data.
Computers can generate accurate results, provided that the input data is correct and the
program of instructions is reliable.
They are not affected by emotion and do what they are programmed to do. Hence, they
can produce consistent result.
If inaccurate data is entered, the computers will generate incorrect results. This is
known as "Garbage In; Garbage Out" (GIGO).
Most of the "computer errors" can be traced to human errors such as incorrect input
data and unreliable programs.
For example, the item prices determined by scanning the bar-codes at the point-of-
sale terminals in supermarkets are far more accurate than those typed in by cashiers.
3. Reliability (Diligence)
Computers built with integrated circuits are more reliable. They have a low failure rate. A
computer is free from tiredness, lack of concentration, fatigue, etc. It can work for hours
without creating any error. Computers are most suitable to handle repetitive tasks because
they do not take tea breaks and sick leaves, and they never complain. If millions of
calculations are to be performed, a computer will perform every calculation with the
same accuracy and resilince. Due to this capability it overpowers human being in routine
CSC 113: Computer For Arts, Social Science And Management P a g e |11
type of work. For example, the automatic teller machines (ATM) are in operation 24
hours a day, 7 days a week.
4. Versatility: - It means the capacity to perform completely different type of work. You
may use your computer to prepare payroll slips. Next moment you may use it for
inventory management or to prepare electric bills.
6. No Intelligent Quotient (IQ): - Computer is a dumb machine and it cannot do any work
without instruction from the user. It performs the instructions at tremendous speed and
with accuracy. It is you to decide what you want to do and in what sequence. So a
computer cannot take its own decision as you can.
7. No Feeling: - It does not have feelings or emotion, taste, knowledge and experience.
Thus it does not get tired even after long hours of work. It does not distinguish between
users.
8. Storage: - The Computer has an in-built memory where it can store a large amount of
data. You can also store data in secondary storage devices such as floppies, which can be
kept outside your computer and can be carried to other computers.
Imagine, if you can, how many filing-cabinet drawers would be required to hold the
thousands of student records kept by your school. It would take a lot of space to store
data and information in paper form. However, computers can store them on several disks
that take up less space than a first-aid box.
CSC 113: Computer For Arts, Social Science And Management P a g e |12
1.8. Classification of Computers
Computers differ based on their data processing abilities. They are classified according to
i. Purpose,
ii. Data handling,
iii. Size, and
iv. Functionality
i. According to Purpose, computers are either general purpose or specific purpose.
General purpose computers are designed to perform a range of tasks. They have the ability to
store numerous programs, but lack in speed and efficiency.
Specific purpose computers are designed to handle a specific problem or to perform a specific
task. A set of instructions is built into the machine.
iii. According to size, computers are classified as Super Computer, Mainframe Computer,
Mini Computer, and Micro Computer or Personal Computer.
Computer
The chief difference between a supercomputer and a mainframe is that a supercomputer channels
all its power into executing a few programs as fast as possible, whereas a mainframe uses its
power to execute many programs concurrently.
c. Mini Computer: - A midsized computer. In size and power, minicomputers lie between
workstations and mainframes. In the past decade, the distinction between large minicomputers
and small mainframes has blurred, however, as has the distinction between small minicomputers
and workstations. But in general, a minicomputer is a multiprocessing system capable of
supporting from 4 to about 200 users simultaneously.
CSC 113: Computer For Arts, Social Science And Management P a g e |14
a. Server usually refers to a computer that is dedicated to provide a service. For example, a
computer dedicated to a database may be called a "database server". "file servers" manage a
large collection of computer files. "Web servers" process web pages and web applications. Many
smaller servers are actually personal computers that have been dedicated to provide services for
other computers.
CSC 113: Computer For Arts, Social Science And Management P a g e |15
Section B: Computer Hardware and Software
Computer Hardware: functional components, modern input and output units
Computer Software: Operating systems, application packages
2.1.1 Introduction
Computers are often compared to human beings since both have the ability to accept data, store,
work with it, retrieve and provide information. The main difference is that human beings have
the ability to perform all of these actions independently. Human beings also think and control
their own activities. The computer, however, requires a program (a predefined set of instructions)
to perform an assigned task. Human beings receive information in different forms, such as eyes,
ears, nose, mouth, and even sensory nerves. The brain receives or accepts this information,
works with it in some manner, and then stores in the brain for future use. If information at the
time requires immediate attention, brain directs to respond with actions. Likewise the Central
Processing Unit (CPU) is called the brain of the computer. It reads and executes program
instructions, performs calculations and makes decisions.
A computer system is the integration of physical entities called hardware and non-physical
entities called software. The hardware components include input devices, processor, storage
devices and output devices. The software items are programs and operating aids (systems) so that
the computer can process data. The main components of a computer system are showing in
figure 1 below.
CSC 113: Computer For Arts, Social Science And Management P a g e |16
Figure 1: Main components of a computer system
Computer system is a tool for solving problems. The hardware should be designed to operate as
fast as possible. The software (system software) should be designed to minimize the amount of
idle computer time and yet provide flexibility by means of controlling the operations. Basically
any computer is supposed to carry out the following functions.
Accept the data and program as input - Store the data and program and retrieve as and
when required.
Process the data as per instructions given by the program and convert it into useful
information.
Communicate the information as output.
Based on the functionalities of the computer, the hardware components can be classified into
four main units, namely
1) Input Unit
2) Output Unit
3) Central Processing Unit
4) Memory Unit
These units are interconnected by minute electrical wires to permit communication between
them. This allows the computer to function as a system. The block diagram is shown below.
CSC 113: Computer For Arts, Social Science And Management P a g e |17
Figure 2: Functional Units of a Computer System
Input Unit
A computer uses input devices to accept the data and program. Input devices allow
communication between the user and the computer. In modern computers keyboard, mouse, light
pen, touch screen etc, are some of the input devices.
Output Unit
Similar to input devices, output devices have an interface between the computer and the user.
These devices take machine coded output results from the processor and convert them into a
form that can be used by human beings. In modern computers, monitors (display screens) and
printers are the commonly used output devices
Central processing unit (CPU) is the brain of any computer system. It is just like the human brain
that takes all major decisions, makes all sorts of calculations and directs different parts of the
computer function by activating and controlling the operation. It consists of arithmetic and logic
units, control unit and internal memory (registers). The control unit of the CPU coordinates the
action of the entire system. Programs (software) provide the CPU, a set of instruction to follow
and perform a specific task.
Between any two components of the computer system, there is a pathway called a bus.
A bus is a group of wires on the main circuit board of the computer. It is a pathway for data
flowing between components. Most devices are connected to the bus through a controller which
coordinates the activities of the device with the bus.
Control unit controls all the hardware operations, i.e, those of input units, output units, memory
unit and the processor. The arithmetic and logic units in computers are capable of performing
addition, subtraction, division and multiplication as well as some logical operations. The
CSC 113: Computer For Arts, Social Science And Management P a g e |18
instructions and data are stored in the main memory so that the processor can directly fetch and
execute them.
Memory Unit
RAM is also known as main memory: A fast central processing unit is useless without an
adequate amount of RAM (Random Access Memory). RAM is usually referred to as a
computer's memory -- meaning it stores information that is used by running programs or
applications. More memory lets you run more applications at the same time without degrading
your system's performance.
The main memory holds data and program only temporarily. Hence there is a need for storage
devices to provide backup storage. They are called secondary storage devices or auxiliary
memory devices. Secondary storage devices can hold more storage than main memory and is
much less expensive. All modern computers use Von – Neumann concept to store program.
The CPU is the brain of the computer system. It performs arithmetic operations as well as
controls the input, output and storage units. The functions of the CPU are mainly classified into
two categories:
The arithmetic and logic unit (ALU) is the part of CPU where actual computations take place.
It consists of circuits which perform arithmetic operations over data received from memory and
are capable of comparing two numbers.
The control unit directs and controls the activities of the computer system. It interprets the
instructions fetched from the main memory of the computer, sends the control signals to the
devices involved in the execution of the instructions.
CSC 113: Computer For Arts, Social Science And Management P a g e |19
While performing these operations the ALU takes data from the temporary storage area inside
the CPU named registers. They are high-speed memories which hold data for immediate
processing and results of the processing.
Hard Disk Drive: The hard disk drive (HDD) of the computer is where permanent information
is stored. Documents, databases, spreadsheets, and programs are all stored on the hard disk. The
larger the hard disk, the more you can fit on the drive. The size of the HDD does not affect the
speed at which a program can run, but the HDD speed can affect how fast you can access your
files.
Video Card: The video card is a board that plugs into the PC motherboard to give it display
capabilities. New video cards come with their own RAM and processor to help speed up the
graphics display. Many computers come with video chips built in. That makes a separate video
card unnecessary, unless the computer is going to be used for high-end multimedia work or to
play video games.
Sound Card: Like video cards, sound cards are expansion boards used for enabling a computer
to manipulate sound. Most sound cards give you the power to plug in speakers and a
microphone. Some even give you the jacks for hooking your computer up to a common stereo.
As with video cards, many computers come with sound chips, making it unnecessary to buy a
separate card, unless you need higher sound quality for your work.
Modem: The modem allows your computer to use a telephone line to communicate and connect
to the Internet.
Network Card: A network card allows your computer to be connected either to other computers
or to the Internet if you are using a fast Internet connection such as cable or dsl.
Fans: One or more fans inside the computer keep air moving and keep your computer cool.
Cables: Numerous wires and flat, ribbon-like cables provide power and communication to the
various parts inside your computer.
An Operating System (OS) is a program that acts as an intermediary between the user of a
computer and computer hardware. It provides an environment in which other programs can do
useful work. It controls execution of programs to prevent errors and improper use of the
computer. The OS manages these resources and allocates them to specific programs and users.
With the management of the OS, a programmer is rid of difficult hardware considerations.
CSC 113: Computer For Arts, Social Science And Management P a g e |20
Figure 4: System Units
Functions of an Operating System
1. Simplify the execution of user programs and make solving user problems easier.
2. Allow sharing of hardware and software resources.
3. Make application software portable and versatile.
4. Provide isolation, security and protection among user programs.
5. Improve overall system reliability, fault tolerance, reconfiguration.
a) There is need to understand interaction between the hardware and applications e.g new
applications, new hardware.
b) Need to understand basic principles in the design of computer systems for efficient resource
management, security, and flexibility.
c) Increasing need for specialized operating systems e.g. embedded operating systems for
devices - cell phones, sensors and controllers. Other areas include real-time operating
systems such as vehicles, aircraft control, multimedia services.
a) An operating system provides services to programs and to the users of those programs. It
provided by one environment for the execution of programs.
b) The common service provided by the operating system is listed below.
i. Program execution: Operating system loads a program into memory and executes the
program. The program must be able to end its execution, either normally or abnormally.
CSC 113: Computer For Arts, Social Science And Management P a g e |21
ii. Input/output Operation: I/O means any file or any specific I/O device. Program may
require any I/O device while running. So operating system must provide the required I/O.
iii. File system manipulation: Program needs to read a file or write a file. The operating
system gives the permission to the program for operation on file.
iv. Communication: Data transfer between two processes is required for some time. The both
processes are on the one computer or on different computer but connected through computer
network. Communication may be implemented by two methods:
a. Shared memory
b. Message passing.
v. Error detection: error may occur in CPU, in I/O devices or in the memory hardware. The
operating system constantly needs to be aware of possible errors. It should take the
appropriate action to ensure correct and consistent computing.
Batch system
Batch operating system is one where programs and data are collected together in a batch before
processing starts. Some computer systems only did one thing at a time. They had a list of the
computer system may be dedicated to a single program until its completion, or they may be
dynamically reassigned among a collection of active programs in different stages of execution.
Memory is usually divided into two areas in batch system: Operating system and user program
area.
CSC 113: Computer For Arts, Social Science And Management P a g e |22
Time-sharing system
Time-sharing system or multitasking: multiple users have terminals (not computers) connected
to a main computer and execute her task in the main computer. It allows many users to share the
computer simultaneously, each user is given the impression that she has her own computer,
whereas actually one computer is being shared among many users.
Multiprocessor system
Multiprogramming system
Multiprogramming: When two or more programs are in memory at the same time, sharing the
processor is referred to the multiprogramming operating system. Multiprogramming assumes a
single processor that is being shared. It increases CPU utilization by organizing jobs so that the
CPU always has one to execute. The operating system keeps several jobs in memory at a time.
This set of jobs is a subset of the jobs kept in the job pool. The operating system picks and
begins to execute one of the jobs in the memory.
Advantages
1. High CPU utilization.
2. It appears that many programs are allotted CPU almost simultaneously.
Disadvantages
1. CPU scheduling is requires.
CSC 113: Computer For Arts, Social Science And Management P a g e |23
2. To accommodate many jobs in memory, memory management is required.
Distributed system
Distributed : Distributes computation among several physical processors. The processors do not
share memory or a clock. Instead, each processor has its own local memory. They communicate
with each other through various communication lines.
Application packages are bundle of two or more computer programs or packages designed to
enable the computer to solve a specific task. For example, the word processor package will
enable the user to type, print and store documents in their computer in a manner they appreciate
and understand.
Word processing: for writing letters, reports and other documents. Examples: Microsoft Word,
Word Perfect. Facilities include: editing of text, font & size changing, find & replace, spell
checker, word count, mail merging (combining data from a database with text in a standard
letter to produce customised letters).
Spreadsheet modeling: for producing invoices and cost plans. It can be used to create models,
simulations or expert systems for others to use. Examples: Microsoft Excel, Microsoft Access.
Facilities include: entry of formulas to perform calculations, also ability to display data in
graphical and chart form. Acts rather like a multifunction pocket calculator, but once set up for a
particular purpose there is no need to remember all the formula and functions each time you use
it.
Graphics package: for drawing and painting. Examples: Microsoft Paintbrush, Serif Photoshop.
Facilities include: cropping, resizing, various digital filters, drawing, painting and editing tools.
CSC 113: Computer For Arts, Social Science And Management P a g e |24
1. An application package meets the exact needs of the user. Since it is designed specifically
with one purpose in mind, the user knows that he has to use one specific package to
accomplish his task.
2. The threat of viruses invading custom-made applications is very small, since any business
that incorporates it can restrict access and can come up with means to protect their
network as well.
3. Licensed application software gets regular updates from the developer for security
reasons. Additionally, the developer also regularly sends personnel to correct any
problems that may arise from time to time.
4. They are efficient in terms of speed, storage and documentation.
5. They are properly documented.
1. Developing application software designed to meet specific purposes can prove to be quite
costly for developers. This can affect their budget and their revenue flow, especially if
too much time is spent developing software that is not generally acceptable.
2. Some software that are designed specifically for a certain business, may not be
compatible with other general software. This is something that can prove to be a major
stumbling block for many corporations.
3. Developing them is something that takes a lot of time, because it needs constant
communication between the developer and the customer. This delays the entire
production process, which can prove to be harmful in some cases.
4. Application software that is used commonly by many people, and then shared online,
carries a very real threat of infection by a computer virus or other malicious programs.
5. If computer virus or other malicious programs enter your whole data then packages will
be damaged including computer.
Practice Questions
CSC 113: Computer For Arts, Social Science And Management P a g e |26
Section C: Program Development: Algorithm, Pseudocode and
Flowchart
Objectives:
Explain the meaning of program
Mention and use programming development tools
Machine language is the fundamental language of the computer’s processor, also called Low
Level Language; all programs are converted into machine language before they can be executed;
it consists of combination of 0’s and 1’s that represent high and low electrical voltage. Programs
written in machine code do not need further conversion. Assembly language is a low level
language that is similar to machine language; it uses symbolic operation code to represent the
machine operation code; it makes use of an assembler to convert the language code to machine
code.
High level language is computer (programming) languages that are easier to learn; uses English
like statements. Examples are C ++, Visual Basic, Pascal, Fortran and C# etc. Program written in
high level language need to be translated into machine readable code using either compiler or
interpreter. That is there are two ways to run programs written in a high-level language. The
most common is to compile the program; the other method is to pass the program through an
interpreter. An interpreter is a computer program that directly executes, i.e. performs,
instructions written in a programming or scripting language, without previously compiling them
into a machine language program. An interpreter generally uses one of the following strategies
for program execution:
CSC 113: Computer For Arts, Social Science And Management P a g e |27
2. translate source code into some efficient intermediate representation and immediately
execute this.
3. explicitly execute stored precompiled code made by a compiler which is part of the
interpreter system.
An interpreter translates high-level instructions into an intermediate form, which it then executes.
In contrast, a compiler translates high-level instructions directly into machine language.
A compiler is a computer program (or set of programs) that transforms source code written in
a programming language (the source language) into another computer language (the target
language, often having a binary form known as object code). The most common reason for
converting a source code is to create an executable program. Compiled programs generally run
faster than interpreted programs.
The advantage of an interpreter, however, is that it does not need to go through the compilation
stage during which machine instructions are generated. This process can be time-consuming if
the program is long. The interpreter, on the other hand, can immediately execute high-level
programs. For this reason, interpreters are sometimes used during the development of a program,
when a programmer wants to add small sections at a time and test them quickly. In addition,
interpreters are often used in education because they allow students to program interactively.
Both interpreters and compilers are available for most high-level languages.
However, BASIC and LISP are especially designed to be executed by an interpreter. In
addition, page description languages, such as PostScript, use an interpreter. Every
PostScript printer, for example, has a built-in interpreter that executes PostScript instructions.
Note that in each of the stages above, proper documentation is required with the view of keeping
the records and details of activities in each stage. Proper documentation makes it easy for quick
understanding of the program details by people that were not involved at the initial development
of the program.
3.3 Algorithm
CSC 113: Computer For Arts, Social Science And Management P a g e |28
Before writing one piece of computer code, it is important to know what the program is supposed
to do. Hence going straight to coding can be very confusing. It is a good idea to write a program
in a simple way first to ensure that all requirements are included before writing one line of code
in any language. Thus this can be achieved using Algorithm.
Alternatively, we can define an algorithm as a set or list of instructions for carrying out some
process step by step.
In the same way, algorithms executed by a computer can combine millions of elementary steps,
such as additions and subtractions, into a complicated mathematical calculation. Also by means
of algorithms, a computer can control a manufacturing process or coordinate the reservations of
an airline as they are received from the ticket offices all over the country. Algorithms for such
large-scale processes are, of course, very complex, but they are built up from pieces.
3.4 Pseudocode
Pseudocode is a simple way of writing programming code in English. Pseudocode is not an
actual programming language. It uses short phrases to write code for programs before you
actually create it in a specific language. Once the objective of a program is known and how it
functions, then pseudocode can be used to create statements to achieve the required results for
the program.
Pseudocode is a detailed yet readable description of what a computer program or algorithm must
do, expressed in a formally-styled natural language rather than in a programming language.
Pseudocode is sometimes used as a detailed step in the process of developing a program. It
allows designers or lead programmers to express the design in great detail and provides
programmers a detailed template for the next step of writing code in a
specific programming language.
Because pseudocode is detailed yet readable, it can be inspected by the team of designers and
programmers as a way to ensure that actual programming is likely to match design
specifications. Catching errors at the pseudocode stage is less costly than catching them later in
the development process. Once the pseudocode is accepted, it is rewritten using the vocabulary
and syntax of a programming language. Pseudocode is sometimes used in conjunction with
computer-aided software engineering-based methodologies.
Examples of pseudocode
Example 1: Write the pseudocode to calculate the sum and average of two numbers.
Solution
CSC 113: Computer For Arts, Social Science And Management P a g e |30
Example 2: Write the pseudocode to compute the area of a triangle given the base and the
height of the triangle. (Hint: Area = ½ * base * height)
Solution
[pseudocode for calculate area of a triangle]
Step1 : Start
Step2 : Read two numbers base, height
Step3 : Calculate area = ½ * base * height
Step4 : Print area, base , height
Step5 : Stop
[End of pseudocode for calculate sum and average of two numbers]
Solution
Example 4: Sola AD Ltd is into plastic production and the required working hours is between
8.00am to 4.00pm daily. An employee can choose to work extra hours for a
minimum of 3 hours and maximum of 5 hours on daily basis in addition to the
regular daily working hours. On regular working hour, employee wage per hour is
N500.00. On extra hour hours worked, wage per extra hour worked is N50.00.
The company is opened for work only from Monday to Friday every week. Write
the pseudocode that will accept employee ID number, employee name, daily
working hours of employee and help the company to compute the daily wage
received by employee
Solution
CSC 113: Computer For Arts, Social Science And Management P a g e |31
Step 3: Test if employee daily working hour exceed 8 hours and calculate the extra hour
worked and compute the employee daily wage.
If employee daily working hour > 8 hours then
Employee extra hour = employee daily working hour – 8
Employee daily wage = 8 * 500.00 + (employee extra hour * 50.00)
Otherwise
Employee daily wage = employee daily working hour * 8
End If
Step 5: Output the employee ID number, employee name, employee daily wage
Step 6: Stop
[End of pseudocode to compute employee daily wage]
Example 5 Write the pseudocode that will accept continuous assessment (CA) mark scored
by student, examination mark scored by student. CA is a maximum of 30% while
examination mark is a maximum of 70%. There are instances where the total
marks of CA done by lecturer may be above 30% and also the total marks of
examination set be lecturer may be above 70%. The pseudocode should scale
down the student’s CA and examination mark to 30% and 70% respectively if it
happens that the CA and examination marks exceed the 30% and 70%
respectively. The sum of the CA and the examination mark is computed. The
pseudocode should display whether a student is successful or not. A student is
successful if the overall mark (i.e. sum of CA and Examination mark) is greater
than or equal to 45%.
Solution
3.5 Flowchart
(Dictionary definition): Flowchart is a schematic representation of a sequence of operations, as in
a manufacturing process or computer program.
Flowcharting is a tool developed in the computer industry, for showing the steps involved in a
process. A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by
arrows - each shape represents a step in the process, and the arrows show the order in which they
occur. Flowcharting combines symbols and flow lines, to show figuratively the operation of an
algorithm.
Computer program flowcharts are used to show control flow in a computer program. It is
sometimes used to show an algorithm without writing the code. Sometimes they are used
for training purposes for beginner programmers who don't know programming codes but can
understand graphical symbols in flowcharts.
A flowchart is a logic diagram to describe each step that the program must perform to arrive at
the solution. A popular logic tool used for showing an algorithm in graphics form.
A Flowchart
a. shows logic of an algorithm
b. emphasizes individual steps and their interconnections
c. control flow from one action to the next
Flowchart symbols:
CSC 113: Computer For Arts, Social Science And Management P a g e |33
Example 1: Draw the flowchart and write the pseudocode to determine a student’s final grade
and indicate whether it is passing or failing. The final grade is calculated as the
average of four marks.
Step 1 Start
Step 2: Input M1,M2,M3,M4
Step 3: GRADE
(M1+M2+M3+M4)/4
Step 4: if (GRADE <50) then
Print “FAIL”
else
Print “PASS”
Endif
Step 5: Stop
CSC 113: Computer For Arts, Social Science And Management P a g e |34
Example 2: Draw the flowchart and write the pseudocode to convert the length in feet to
centimeter
Step 1: Start
Step 2: Read Lft
Step 3: Lcm = Lft *30.48
Step 4: Print Lcm
Step 5: Stop
CSC 113: Computer For Arts, Social Science And Management P a g e |35
Example 3: Draw the flowchart and write the pseudocode that will read the two sides of a
rectangle and calculate its area.
Pseudocode Flowchart
Step 1: Start
Step 2: Read Length, Breadth
Step 3: [Compute Area]
Area = Length * Breadth
Step 4: Print Area
Step 5: Stop
Example 4: Draw the flowchart and write the pseudocode that reads two values, determines
the larger value and prints the larger and smaller value with an identifying
message.
Pseudocode Flowchart
Step 1: Start
Step 2: Input A, B
Step 3: if (A< B) then
MAX B
SMALL A
else
MAX A
SMALL B
endif
Step 4: Print “The largest value is”, MAX, SMALL
Step 5: Stop
CSC 113: Computer For Arts, Social Science And Management P a g e |36
Example 5: Draw the flowchart and write the pseudocode that reads three numbers and prints
the value of the largest number.
Pseudocode
Step 1: Start
Step 2: Input N1, N2, N3
Step 3: if (N1>N2) then
if (N1>N3) then
MAX N1 [N1>N2, N1>N3]
else
MAX N3 [N3>N1>N2]
endif
else if (N2>N3) then
MAX N2 [N2>N1, N2>N3]
else
MAX N3 [N3>N2>N1]
endif
endif
Step 4: Print “The largest number is”, MAX
Step 5: Stop
CSC 113: Computer For Arts, Social Science And Management P a g e |37
Section D: Applications of Computing
Computer application areas and technological trends
Using personal computers as effective problem solving tools for the present and the
future
1. Modeling
Computer modeling is the use of computers to create abstract models of real life objects,
organisms, situations, or systems. A computer model is not static, you can feed data in
and examine how it behaves under certain conditions. E.g. A financial manager can
create a spreadsheet to project the profit and loss of his company.
2. Simulation of experiments
A computer simulation refers to the use of computers to execute a model. It is represented
by a computer program that gives information about the object, situation or system being
examined.
3. Weather forecasting
Several government agencies collect a lot of weather data from satellites, weather
balloons, airplanes in flight, ground weather stations and overseas reports on a per minute
basis every day. It is however, practically cumbersome or impossible for the scientists to
process and analyze them manually. Hence, high-speed computers play a significant role
in gathering and analyzing these data.
In order to provide more timely and reliable weather forecasts, the Hong Kong
Observatory has acquired a CRAY supercomputer. This supercomputer takes less than
one hour to produce a 24-hour forecast using a 20 km by 20 km grid high-resolution
numerical weather prediction model. Note that the old computer takes more than 5
months to perform the same calculation.
The computers also support scientists to develop new weather models for improving the
quality of weather forecast.
CSC 113: Computer For Arts, Social Science And Management P a g e |39
The computer-controlled equipment can perform dangerous and repetitive tasks for
humans.
The computer-controlled equipment reduces production costs because it does not
require any annual leave, sick leave and other fringe benefits.
3. Transportation systems
Traffic lights control:- In order to optimise a traffic flow, a computer system can
be used to coordinate the signal timings of the adjacent traffic lights in a district. The
system can monitor the traffic flows in real time by collecting traffic flow data from
different traffic sensors placed at various locations. . Based on the current traffic flow
situation, the system will send signal control instructions to the traffic lights to adjust
their signal timings in order to minimise delays and reduce stopping time.
To flag the possible incidents on the road network, the system can also compare the
current traffic flow profiles with a typical one. If there are significant differences, the
system will give warning signals.
CSC 113: Computer For Arts, Social Science And Management P a g e |40
The automatic grading of exercises feature frees up teachers' resources that can be
used for additional attention toward students.
Students can learn at their own pace. This alleviates the pressure on the slow learners
so that they can keep up with their peers.
Students are free to make wrong answers because there is no peer group pressure.
This encourages them to learn by trials and errors.
Multimedia contents can help make difficult or abstract concepts simple.
2. Information searching
The World Wide Web is a system of interlinked hypermedia documents that enables
users to find and retrieve information by navigating. A hypermedia document is a
document that contains text, graphics, sounds, video and animation.
How does a search engine work?
Most search engines keep a huge index of the Web pages on the World Wide Web.
This index is maintained by software agents, sometimes called spiders or software
robots. They automatically search for new information on the Web and update the
index. When the search engine receives a search request, it compares the input
keywords to the entries in the index, and returns the results.
4. Administrative tools
There quite a number of School Administration and Management Software System which
have been implemented to provide administration and management supports for schools.
These educational administration software aims to provide a computerized network
CSC 113: Computer For Arts, Social Science And Management P a g e |41
system to schools for supporting the administrative and management processes, and for
transmitting electronically information between schools and the Education and
Manpower Bureau.
Some of the major functions of the educational administration software include the
followings:
School management
- To maintain school information.
- To collate data for the preparation of statistical reports and forms.
Students' assessments
- To print students' assessment reports.
- To support the operation of the allocation systems with assessment data.
Staff deployments
- To keep records of staffs' absences.
- To automate the process of deploying substitute teachers.
- To transmit the vacation leave applications and substitute teachers appointment
applications to the Education and Manpower Bureau through an electronic data
exchange system.
Timetabling
- To schedule timetables which show lesson arrangements for classes, teachers and
venues respectively.
2. Software in OA
Word processing software
Suppose your school wants to send a personalized letter to invite all the parents to attend
a meeting. The contents of each letter are the same except for the names and addresses of
CSC 113: Computer For Arts, Social Science And Management P a g e |42
the parents. Since typing individual letters to so many parents is a time-consuming task,
with the help of the mail merge function of a word processing software, you can generate
these personalized letters in a short time.
Spreadsheet software
Suppose you want to know the effects of the change of import levy on the balance
(surplus or deficit) of the budget. With the spreadsheet software, you only have to enter
the new fee and the software will do the recalculation automatically. Without this
software, you may have to spend a lot of time recalculating all the data to get to your new
budget balance.
Suppose a teacher wants to find out how many students are living in Igbo Elerin. She
enters the query into the computer and the database management software will give her
the results instantly. Without this database management software, she will have to search
the student records from the student files manually.
Presentation software
Suppose you have to make a project presentation. With the presentation software, you
can create all the slides easily with the layout provided by the software. You can also
enhance your slides by applying special effects to the slide contents and the transitions
between each slide. However, it is difficult to produce these effects manually.
Suppose the principal wants to hold an urgent meeting after school. He/She can inform
every teacher by just sending one e-mail and the e-mail will be received almost instantly.
Without an e-mail facility, he/she may have to circulate a memo among the teachers or
post a notice on the notice board of each staff room.
CSC 113: Computer For Arts, Social Science And Management P a g e |43
Input devices:
A card reader: to capture the account information stored on the magnetic strips of the
users' plastic cards.
A keypad: to allow the users to enter transaction information.
Output devices:
A monitor: to display information and instructions to users.
A printer: to print transaction receipts.
A cash dispenser: to deliver bank notes to users.
Cash withdrawal
Money transfer from one account to another
Bills payment
Checking of account balances
- request cheque books and bank statements
- change personal identification number
Advantages of an ATM
CSC 113: Computer For Arts, Social Science And Management P a g e |44
It provides routine banking services 24 hours a day, 7 days a week.
It helps banks save human resources, hence reducing their labour cost.
2. Internet banking
The following services can be accessed via the Internet banking platform of commercial
banks:
Fund transfer from one account to another.
pay bills now or schedule future payments.
check account balances and transaction history.
access previous account statements.
request cheque books.
initiate stop payment requests.
change personal identification number.
trade stocks, view major indices and get stock quotes.
view currency exchange and interest rates.
place fixed-time deposits and change maturity instructions.
apply for credit cards and various types of loans.
enroll in insurance plans.
CSC 113: Computer For Arts, Social Science And Management P a g e |45
The customers can manage their finances anytime, anywhere without visiting the
bank in person.
It helps to save the bank's human resources, hence reducing the operation cost.
The Universal Product Code (UPC) is a system for uniquely identifying different
products. Each product has its own unique code number on its label represented by a
pattern of light and dark bars.
The Point of Sale (POS) terminal is a special-function elctornic device used to process
card payments at retail outlets. In retail outlets, it is a combination of an electronic cash
register, a bar code scanner or reader and software, a A POS terminal generally does the
following:
A bar code scanner or reader (also called a price scanner or point-of-sale ( POS )
scanner), is a hand-held or stationary input device used to capture and read information
contained in a bar code .
A barcode reader consists of a scanner , a decoder (either built-in or external), and a cableused to
connect the reader with a computer. Because a barcode reader merely captures and translates the
barcode into numbers and/or letters, the data must be sent to a computer so that a software
application can make sense of the data.
CSC 113: Computer For Arts, Social Science And Management P a g e |46
Barcode scanners can be connected to a computer through a serial port , keyboard port , or an
interface device called a wedge . A barcode reader works by directing a beam of light across
the bar codeand measuring the amount of light that is reflected back. (The dark bars on a barcode
reflect less light than the white spaces between them.) The scanner converts the light energy into
electrical energy, which is then converted into data by the decoder and forwarded to a computer.
There are five basic kinds of barcode readers -- pen wands, slot scanners, Charge-Couple Device
( CCD ) scanners, image scanners, and laser scanners.
A pen wand is the simplest barcode reader. It contains no moving parts and is known for its
durability and low cost. A pen wand can present a challenge to the user, however, because it
has to remain in direct contact with the bar code, must be held at a certain angle, and has to
be moved over the bar code at a certain speed.
A slot scanner remains stationary and the item with the bar code on it is pulled by hand
through the slot. Slot scanners are typically used to scan bar codes on identification cards.
A CCD scanner has a better read-range than the pen wand and is often used in retail sales.
Typically, a CCD scanner has a "gun" type interface and has to be held no more than one
inch from the bar code. Each time the bar code is scanned, several readings are taken to
reduce the possibility of errors. A disadvantage of the CCD scanner is that it cannot read a
bar code that is wider than its input face.
An image scanner, also called a camera reader, uses a small video camera to capture an
image of the bar code and then uses sophisticated digital image processing techniques to
decode the bar code. It can read a bar code from about 3 to 9 inches away and generally costs
less than a laser scanner.
A laser scanner, either hand-held or stationary, does not have to be close to the bar code in
order to do its job. It uses a system of mirrors and lenses to allow the scanner to read the bar
code regardless of orientation, and can easily read a bar code up to 24 inches away. To
reduce the possibility of errors, a laser scanning may perform up to 500 scans per second.
Specialized long-range laser scanners are capable of reading a bar code up to 30 feet away.
4. Smart cards
A smart card looks like a credit card in size and shape, but instead of a magnetic strip it
contains an embedded microprocessor and memory. One popular use of smart cards is its
stored value. Each time you use the card, the available of amount of currency (e.g Naira)
is reduced.
1. Computer games
Types of computer games:
Adventure games
In adventure games, the players become characters in situations they know only a little
about. The characters will then encounter different phases of the adventure, and only
successful problem solvings with the given resources and information will move them
one step ahead to accomplish the required mission.
Arcade games
Arcade games are similar to games such as pinball and darts found in an amusement
arcade.
Strategy games
Strategy games require the players to use strategies to win. They are often implemented
as board games such as chess and backgammon.
Simulation games
Simulation games allow players to explore artificial environments, imaginary or based on
the real world. The players can experience the consequences of their actions.
Role-play games
Role-play games assume the player the guise of a character and acts out that role.
Psychomotor games
Psychomotor games require intellectual and motor skills. Joysticks or game paddles are
often used for input. For example, space games and computer-simulated sports games.
Combat games
Combat games require players pitting against each other until there is a clear winner.
2. Edutainment
Edutainment comes from two words: EDUcation and EnterTAINMENT. It means the
combination of education with entertainment. Most of the edutainment software use
multimedia elements to entertain users while they learn.
Aims and objectives:- Does the software meet its stated aims and objectives?
Does the software meet your instructional aims?
Feedback:- Does the software present effective feedback for correct responses?
Does the software present effective feedback for incorrect responses?
Does the software provide learners with a summary of performance?
Ease of use:- Is minimum computer skills needed to use the software? Is the user
interface easy to use? Are potential errors trapped?
Does the software provide helpful messages to correct learner errors?
Student control:- Can the learners control the rate of presentation? Can the learners
control the sequence of learning? Can the learners control the time allowed for
responding? Can the learners control the level of difficulty?
Can the learners temporarily suspend the learning and resume it from the point of
suspension? Can the learners review previous information?
Documentation:- Are the user manual and installation guide included? Are the
instructions clear and easy to understand? Are the aims and objectives clearly stated?
Are the intended learners clearly stated? Are suggested ways to use included?
Are other resource materials included?
Many web sites send cookies ( a small file that allows a web site to record users'
data) to the user browsers to collect personal information such as users' interests,
preferences, and surfing patterns on the web sites.
In order to establish an e-mail account or become a member of a web site, you
have to do a registration. In the registration process, you need to complete a
questionnaire from which your personal information such as name, postal and e-
mail addresses, telephone number and so on are gathered by the web site.
CSC 113: Computer For Arts, Social Science And Management P a g e |50
The misuse of personal information
New technology sometimes is not accepted by everybody. One may refuse to use e-mail
or a credit card. The most common reason cited for this attitude is the fear of one's
personal information being misused. Here are some examples of misuse of personal
information:
A magazine publisher may sell subscriber lists to direct marketers, fund-raisers, and
others.
An employee of a telephone company may be bribed by a loan collection company to
provide addresses and telephone numbers of loan borrowers by performing computer
searches.
A company may send employees to the Registrar of Marriages offices to gather
publicly accessible information about people who will marry in the next few weeks.
Then, this information is sold to restaurants, bridal photography salons, travel
agencies, real-estate agencies and so on so that they can market their business.
i. Theft by computers:- Computers are being used to steal money, information, goods
and computer services. Here are two examples:
Some viruses are activated as soon as the infected programs or files are used; other
viruses lie dormant until certain conditions, such as a specific date or time, cause
their code to be executed. Some viruses do nothing, displaying some unexpected
messages on the screen, but some do destroy data on a disk or reformat a hard disk.
Since many data are stored on computers today, loss of them by virus attacks will
cost work time and financial loss.
Site licence: it is an agreement that grants the buyer of the software the right
to use that software on a given number of computers. The price is less than
that of buying a separate copy for each computer.
Network version: it permits the buyer to purchase just one copy of the
software (in network version) that can legally load into his/her network server.
Shareware: it is a software distributed free for a trial period. If the user wants
to use it regularly, he/she should pay for it on a honour system.
Freeware: it is a software that is provided to users at no cost, but it is still
copyrighted. It means resale of it is not allowed.
Here are two examples of committing a criminal offence after the amended law t akes
effect:
An IT training instructor buys one copy of a software which is licenced for use in one
computer only. But he installs this software in all the computers in the computer
laboratory.
An IT manager of a trading company buys one copy of an accounting software which
is licenced for use in one computer only. But he asks his subordinate to install it in a
LAN server for shared use by all the employees in the accounting department.
4.2.4 Ethical issues:- Ethics deals with what is considered right or wrong. In theory,
one can distinguish between illegal acts and unethical acts. An illegal act breaks the law, but an
unethical act may not break the law. In many cases, illegal acts are unethical as well.
Examples of ethical issues
CSC 113: Computer For Arts, Social Science And Management P a g e |52
A teacher reads a student's e-mail.
A student forwards an e-mail message to the whole class without permission from the e-
mail sender.
Your friend, who is not studying in your school, asks you to borrow your password to get
access to your school computer system.
The use of computers monitors the job performance of employees. For example, a
computer program is used to monitor the typing speed of typists without the knowing of
the typists.
4.2.5 Employment trends:- Computer usage can lead to displacement of some jobs
which are formerly performed by humans, but it also creates new job opportunities.
Somebody has to be employed to develop software, operate and repair computers and their
peripherals, market computers and software and so on. The followings are some of the
typical jobs generated by computers:
Computer operators
System analysts
Application programmers
System programmers
Database administrators
Network administrators
Customer service engineers
Web masters
Computer instructors
Here are some of other professions that might require computer knowledge:
Real-estate agents, lawyers, researchers and teachers need to use computers to search
information.
Reporters and writers need to use word processing software to write and change
documents.
Accountants, budget controllers, stockbrokers and insurance agents need to use
spreadsheet software to analyse data.
Engineers and architects need to use CAD software to design products or buildings.
CSC 113: Computer For Arts, Social Science And Management P a g e |53
References (Credits)
(Computer Science) the study of computers and their application. Collins English Dictionary:
Complete and Unabridged © HarperCollins Publishers 1991, 1994, 1998, 2000, 2003
comput′er sci`entist,
Random House Kernerman Webster's College Dictionary, © 2010 K Dictionaries Ltd. Copyright
2005, 1997, 1991 by Random House, Inc. All rights reserved.
The American Heritage® Dictionary of Student Science, Second Edition. Copyright © 2014 by
Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt
Publishing Company. All rights reserved.
Peter Denning, CACM, April 2005/Vol. 48, No. 4, pp. 27 - 31, "Is Computer Science, Science?"
Areas of Computer Applications (IT01) June 2002. By Hong Kong Baptist University (Department of
Computer Science) and Newise Supply Limited Education and Manpower Bureau
http://resources.edb.gov.hk/com-lit/index.htm#
Barcode reader. (2015, March 21). In Wikipedia, The Free Encyclopedia. Retrieved 11:12, April
11, 2015, from http://en.wikipedia.org/w/index.php?title=Barcode_reader&oldid=652838653
CSC 113: Computer For Arts, Social Science And Management P a g e |54