Professional Documents
Culture Documents
1
The final activity in the data processing cycle is producing the desired output also referred to
as information. This information can be distributed to the target group or stored for future use.
Distribution is making information available to those who need it and is sometimes called
information dissemination. This process of dissemination may involve electronic presentation
over the radio or television, distribution of hard copies, broadcasting messages over the internet
or mobile phones etc. The output generation can be through screen or monitor, printer, or can
be saved for future use in external devices like USB flash drive, hard disk, etc.
1.4 Computer Operating System
An operating system is a program that acts as an interface between a user of a computer and
the computer resources. The purpose of an operating system is to provide an environment in
which a user may execute programs. The general architecture of an Operating System is giving
below.
The kernel is a computer program at the core of a computer's operating system and has
complete control over everything in the system. It is the "portion of the operating system code
that is always resident in memory", and facilitates interactions between hardware and software
components. A full kernel controls all hardware resources (e.g. I/O, memory, Cryptography)
via device drivers, arbitrates conflicts between processes concerning such resources, and
optimizes the utilization of common resources e.g. CPU & cache usage, file systems, and
network sockets.
The shell, is a computer program which exposes an operating system's services to a human user
or other program. In general, operating system shells use either a command-line interface (CLI)
or graphical user interface (GUI), depending on a computer's role and particular operation. It
is named a shell because it is the outermost layer around the operating system.
Application software, or app for short, is software that performs specific tasks for an end-user.
Effectively, if the user is interacting directly with a piece of software it is application software.
For example, Microsoft Word or Excel are application software, as are common web browsers
such as Firefox or Google Chrome.
A GUI or user interface (UI) is the part of an OS that permits an operator to get the information.
A user interface based on text displays the text as well as its commands which are typed over
a command line with the help of a keyboard. A user is the one or person that is operating the
computer system and also that keys in data for processing into information.
2
2.0 Introduction to Problem Solving
A computer is a very powerful and versatile machine capable of performing a multitude of
different tasks, yet it has no intelligence or thinking power. The intelligence Quotient (I.Q) of
a computer is zero. A computer performs many tasks exactly in the same manner as it is told
to do. This places responsibility on the user to instruct the computer in a correct and precise
manner, so that the machine is able to perform the required job in a proper way. A wrong or
ambiguous instruction may sometimes prove disastrous. In order to instruct a computer
correctly, the user must have clear understanding of the problem to be solved. A part from this
he should be able to develop a method, in the form of series of sequential steps, to solve it.
Once the problem is well-defined and a method of solving it is developed, then instructing
he computer to solve the problem becomes relatively easier task. Thus, before attempt to write
a computer program to solve a given problem.
It is necessary to formulate or define the problem in a precise manner. Once the problem is
defined, the steps required to solve it, must be stated clearly in the required order.
3
requirement to execute it, after writing code in High-level language with the help of a computer.
The algorithm which will need the least time when executed is considered the best.
You may have heard the term algorithm recently, whether it was online or perhaps in some
conversation about technology. It's a word that gets thrown around a lot, but what does it mean
exactly? An algorithm is simply a set of steps used to complete a specific task. They're the
building blocks for programming, and they allow things like computers, smartphones, and
websites to function and make decisions. In addition to being used by technology, a lot of
things we do on a daily basis are similar to algorithms. Let's say you want to make
some spaghetti. In order to do this successfully, there's a certain set of steps you need to follow
in a particular order. First, you'll need to boil a pot of water. Once it's boiling, you then add
the spaghetti and cook it for a set amount of time, stirring occasionally. Once it's finished,
you drain the water, then it's ready to be served with a sauce of your choice.
This entire process is actually an algorithm. Because you followed these steps in a particular
order, you reached your desired outcome: a delicious pasta dish. But if you were to make a
mistake like overcooking or undercooking your noodles, it probably wouldn't be as good.
Programs work in a similar way. Their code is made up of algorithms telling them what to
do.
3.1 Importance of Algorithm
Algorithms give us the most ideal option of accomplishing a task. Here is some importance of
algorithms in computer programming.
▪ To improve the efficiency of a computer program: In programming, there are
different ways of solving a problem. However, the efficiency of the methods available
vary. Some methods are well suited to give more accurate answers than others.
Algorithms are used to find the best possible way of solving a problem. In doing so
they improve the efficiency of a program.
▪ Proper utilization of resources: A typical computer has different resources. One of
them is computer memory. During the execution phase, a computer program will
require some amount of memory. Some programs use more memory space than others.
The usage of computer memory depends on the algorithm that has been used.
▪ Building block of a computer program: Algorithm in computer program is just like
the building plan for engineers. Without following that step by step to completing a
task, it might take a programmer some time to come up with something valuable.
▪ It serves as a guide to solving problem: In programming, algorithm gives direction
and how to use code to implement a particular program. If a programmer fails to adhere
to rules to achieving and completing a task accordingly, then failure will set in.
3.2 Steps Involved in Algorithm Development
1. Identification of input: For an algorithm, there are quantities to be supplied called
input and these are fed externally. The input is to be identified first for any specified
problem.
2. Identification of output: From an algorithm, at least one quantity is produced, called
for any specified problem.
3. Identification the processing operations: All the calculations to be performed in order
to lead to output from the input are to be identified in an orderly manner.
4
4. Processing Definiteness: The instructions composing the algorithm must be clear and
there should not be any ambiguity in them.
5. Processing Finiteness: If we go through the algorithm, then for all cases, the algorithm
should terminate after a finite number of steps.
6. Possessing Effectiveness: The instructions in the algorithm must be sufficiently basic
and in practice they can be carries out easily.
5
Input: The inputs used in an algorithm must come from a specified set of elements,
where the amount and type of inputs are specified.
Output: The algorithm must specify the output and how it is related to the input.
Definiteness: The steps in the algorithm must be clearly defined and detailed. Each
instruction of the algorithm should be clear and unambiguous.
Effectiveness: The steps in the algorithm must be doable and effective. Every
instruction must be basic enough to be carried out theoretically or by using paper and
pencil.
Finiteness: The algorithm must come to an end after a specific number of steps.
Independent: An algorithm should have step-by-step directions, which should be
independent of any programming code.
Feasibility: Should be feasible with the available resources.
Unambiguous: Algorithm should be clear and unambiguous. Each of its steps (or
phases), and their inputs/outputs should be clear and must lead to only one meaning.
3.6 Example
Suppose we want to find the average of three numbers, the algorithm is as follows.
Step 1 Read the numbers a, b, c
Step 2 Compute the sum of a, b and c
Step 3 Divide the sum by 3
Step 4 Store the result in variable d
Step 5 Print the value of d
Step 6 End of the program
Write an algorithm to calculate the simple interest using the formula.
Simple interest = P*N* R/100.
Where P is principal Amount, N is the number of years and R is the rate of interest.
Step 1: Read the three input quantities’ P, N and R.
Step 2: Calculate simple interest as Simple interest = P* N* R/100.
Step 3: Print simple interest.
Step 4: Stop.
4.0 Flowchart
A flow chart is a step-by-step diagrammatic representation of the logic paths to solve a given
problem. Or A flowchart is visual or graphical representation of an algorithm.
The flowcharts are pictorial representation of the methods to be used to solve a given problem
and help a great deal to analyze the problem and plan its solution in a systematic and orderly
manner. A flowchart when translated in to a proper computer language, results in a complete
program.
6
4.2 Differences between Algorithm and Flowchart
• A method of representing the step-by-step logical procedure for solving a problem,
while flowchart is diagrammatic representation of an algorithm. It is constructed using
different types of boxes and symbols.
• It contains step-by-step English descriptions, each step representing a particular
operation leading to solution of problem, on the other hand the flowchart employs a
series of blocks and arrows, each of which represents a particular step in an algorithm.
• These are particularly useful for small problems, while flow charts are useful for
detailed representations of complicated programs.
• For complex programs, algorithms prove to be inadequate while for complex programs,
prove to be adequate.
A flowchart is drawn before writing an actual program to understand the sequence of actions
taken by the solution to solve the problem. It usually draws flowcharts using some standard
symbols as shown below.
7
4.4 Simple Problem using Flowchart
Draw the Flowchart to find Roots of Quadratic equation ax2+ bx + c = 0. The coefficients a,
b, c are the input data.
8
9
10
Draw a flow chart to calculate the average of three numbers.
11
5.0 Pseudo Codes
The Pseudo code is neither an algorithm nor a program. It is an abstract form of a program. It
consists of English like statements which perform the specific operations. It is defined for an
algorithm. It does not use any graphical representation. In pseudo code, the program is
represented in terms of words and phrases, but the syntax of program is not strictly followed.
In computer science, pseudocode is a plain language description of the steps in an algorithm or
another system. Pseudocode often uses structural conventions of a normal programming
language, but is intended for human reading rather than machine reading.
Often at times, algorithms are represented with the help of pseudo codes as they can be
interpreted by programmers no matter what their programming background or knowledge is.
Pseudo code, as the name suggests, is a false code or a representation of code which can be
understood by even a layman with some school level programming knowledge.
12
6.0 Program Objects
Object Programs are programs in machine language form. Normally users write computer
program using high level languages or assembly languages. If program is written in high level
language, then it is to get converted to machine executable form using a Compiler. If program
is prepared in assembly language, it is usually to be converted to machine executable form
using an assembler. Output of compiler or even assemblers are called object program. They
can be directly accomplished by machine.
13