Computer Software and Programming I-63
instructions). Further, algorithm is represented by flowcharts and pseudo codes. These tools make
program logic clear and they eventually help in coding.
4. Testing the algorithm for accuracy: Before converting the algorithms into actual code, it should
be checked for accuracy. The main purpose of checking an algorithm is to identify major logical
errors at an early stage, because logical errors are often difficult to detect and correct at later stages.
The testing also ensures that the algorithm is a ‘true’ one and it should work for both normal and
unusual data.
5. Coding: After meeting all the design considerations, the actual coding of the software takes place
in the chosen programming language. Depending upon application domain and available resources,
a program can be written by using computer languages of different levels such as machine, assem-
bly or high-level languages (HLLs).
6. Test and debug the software: It is common for the initial software code to contain errors. A pro-
gram compiler and programmer-designed test data machine tests the code for syntax errors. The
results obtained are compared with results calculated manually from this test data. Depending upon
the complexity of the software, several rounds of testing may be required.
7. Documentation and implementation: Once the software is free from all the errors, it is the duty
of the software developers to ensure that the software is supported by suitable documentation. After
documentation, the software is installed on the end user’s machine.
7. Briefly describe computer program.Also discuss its characteristics.
Ans: A computer can perform a variety of tasks such as receiving data, processing it and produc-
ing useful results. However, it cannot perform on its own and needs to be instructed to perform even
a simple task. It works on a set of instructions called ‘computer program’, which clearly specifies the
ways to carry out a task.
A program consists of a series of instructions that a computer processes to perform the required
operation. In addition, it also includes some fixed data, required to perform the instructions and the
process of defining those instructions and data. Thus, in order to design a program, a programmer must
determine three basic rudiments which are as follows:
1. The instructions to be performed.
2. The order in which those instructions are to be performed.
3. The data required to perform those instructions.
To perform a task using a program, a programmer has to consider various inputs of the program along
with the process, which is required to convert the input into desired output. Suppose that we want to
calculate the sum of two numbers, A and B, and store the sum in C. Here, A and B are the inputs, addition
is the process and C is the output of the program (Figure 4.3).
Characteristics of a Program
A, B CC = A + B
Input Processing Output
Figure 4.3 Program Performing a Task
M04_ITL-ESL4791_01_SE_C04.indd 63 12/22/2012 4:53:45 PM
I-64 Computer Fundamentals
A program should be written in such a manner that it is easier to understand the underlying logic. A few
important characteristics that a computer program should possess are as follows:
Portability: It refers to the ability of a program to run on different platforms (operating systems)
with or without minimal changes. Due to rapid development in hardware and the software, nowa-
days platform change is a common phenomenon. Hence, if a program is developed for a particular
platform, then the life span of the program is severely affected.
Readability: The program should be written in such a way that it makes other programmers or
users to follow the logic of the program without much effort. If a program is written structurally,
it helps the programmers to understand their own program in a better way. Even if some compu-
tational efficiency needs to be sacrificed for better readability, it is advisable to use a more user-
friendly approach, unless the application’s processing is of utmost importance.
Efficiency: Every program requires certain processing time and memory to process the instruc-
tions and data. As you must have realized, processing power and memory are the most precious
resources of a computer, a program should be laid out in such a manner that it utilizes the least
amount of memory and processing time.
Structural: To develop a program, the task must be broken down into a number of subtasks. These
subtasks are developed independently and each subtask is able to perform the assigned job without
the help of any other subtask. If a program is developed structurally, the program not only becomes
more readable, but also easier for testing and documenting processes.
Flexibility: A program should be flexible enough to handle most of the changes without having
to rewrite the entire program. Most of the programs are developed for a certain period and they
require modifications from time to time. For example, in case of payroll management, as the
time progresses, some employees may leave the company while some others may join. Hence,
the payroll application should be flexible enough to incorporate all the changes without having to
reconstruct the entire application.
Generality: Apart from flexibility, the program should also be general. By generality, we mean
that if a program is developed for a particular task, then it should be able to be used for all similar
tasks of the same domain. For example, if a program is developed for a particular organization,
then it should also suit other similar organizations.
Documentation: It is one of the most important components of an application development. Even if
a program is developed following the best programming practices, it will be rendered useless if the
end user is not able to fully utilize the functionality of the application. A well-documented application
is also useful for other programmers because even in the absence of the author, they can understand it.
8. What are the different types/levels of programming languages?
Ans: Computers understand only one language and that is binary language or the language of 0s and
1s. Binary language is also known as ‘machine language’. In the initial years of computer programming,
all the instructions were given in binary form only. Although these programs were easily understood by
the computer, it proved too difficult for a normal human being to remember all the instructions in the
form of 0s and 1s. Therefore, the computer remained a mystery to a common person until other lan-
guages, such as assembly and HLLs were developed, which were easier to learn and understand. These
languages use commands that have some degree of similarity with English (such as ‘if else’ and ‘exit’).
Programming languages can be divided into three major categories:
M04_ITL-ESL4791_01_SE_C04.indd 64 12/22/2012 4:53:45 PM
Computer Software and Programming I-65
Machine language: It is the native language of computers. It uses only 0s and 1s to represent data
and the instructions.
Assembly language: It corresponds to symbolic instructions and executable machine codes and
was created to use letters instead of 0s and 1s to run a machine.
High-level language: These languages are written using a set of words and symbols following
some rules similar to a natural language such as English. The programs written in HLLs are known
as ‘source programs’ and these programs are converted into machine-readable form by using com-
pilers or interpreters.
9. What is the significance or advantages of different levels of computer languages?
Ans: Every language has its own advantages.
Advantages of machine language
Even though machine language is not a human-friendly language, it offers the following advantages:
Translation free: Machine language is the only language that computers understand. Thus,
the programs written in machine language can be directly executed without the need for conver-
sion.
High speed: Since no conversion is needed, the applications developed using machine language
is extremely fast. It is usually used for complex applications such as space control system, nuclear
reactors and chemical processing.
Advantages of assembly language
Assembly language allows better human-readable method of writing programs as compared to writ-
ing in binary bit patterns. The advantages of using assembly language to develop a program are as
follows:
Easy to understand and use: Assembly language uses mnemonics instead of using numerical
opcodes and memory locations as used in machine language. Hence, the programs written in
assembly language are much easier to understand and use as compared to its machine language
counterpart. Being a more user-friendly language as compared to machine language, assembly
programs are easier to modify.
Less error prone: Since mnemonic codes and symbolic addresses are used, the programmer does
not have to keep track of the storage locations of the data and instructions. Hence, there are fewer
errors while writing an assembly language program. Even in case of errors, assembly programs pro-
vide better facility to locate and correct them as compared to machine language programs. Moreover,
assemblers also provide various mechanisms to locate the errors. For example, in case of adding two
variables such as ADD A, B, if the variables (A and B) are not defined in the program, the assembler
will give an error indicating the same, so that the programmer can easily correct the mistake.
Efficiency: Assembly programs can run much faster and use less memory and other resources
than a similar program written in HLL. The speed increment of 2–20 times faster is common, and
occasionally, an increase of hundreds of times faster is also possible.
More control on hardware: Assembly language also gives direct access to key machine features
essential for implementing certain kinds of low-level routines such as an operating system kernel
or micro-kernel, device drivers and machine control.
M04_ITL-ESL4791_01_SE_C04.indd 65 12/22/2012 4:53:45 PM
I-66 Computer Fundamentals
Advantages of HLLs
HLLs are useful in developing complex software. Unlike assembly language, the programmer need not
learn the instruction set of each computer being worked with. The various advantages of using HLLs
are as follows:
Readability: Since HLLs are closer to natural languages, they are easier to learn and understand.
In addition, a programmer need not be aware of computer architecture; even a common person can
use it without much difficulty. This is the main reason of HLLs popularity.
Machine independent: HLLs are machine independent in the sense that a program created using
HLL can be used on different platforms with very little or no change at all.
Easy debugging: HLLs include the support for ideas of abstraction, so that programmers can con-
centrate on finding the solution to the problem rapidly, rather than on low-level details of data rep-
resentation, which results in fewer errors. Moreover, the compilers and interpreters are designed in
such a way that they detect and point out the errors instantaneously.
Easier to maintain: As compared to low-level languages, the programs written in HLL are easier
to modify and maintain.
Easy documentation: Since the statements written in HLL are similar to natural languages, they
are easier to be documented as compared to low-level languages.
10. What is an algorithm? State its characteristics.
Ans: An ‘algorithm’ is defined as a finite sequence of explicit instructions that when provided with a
set of input values produces an output and then terminates. To be an algorithm, the steps must be unam-
biguous and after a finite number of steps, the solution of the problem should be achieved. However,
algorithms can have steps that repeat (iterate) or require decisions (logic and comparison) until the task
is completed.
Different algorithms may accomplish the same task, with a different set of instructions, in more or
less the same time, space and effort. For example, two different recipes for preparing tea, one ‘add the
sugar’ while ‘boiling the water’ and the other add the sugar ‘after boiling the water’ produce the same
result. However, performing an algorithm correctly does not guarantee a solution, if the algorithm is
flawed or not appropriate to the context. For example, preparing the tea algorithm will fail if there are
no tea leaves present; even if all the motions of preparing the tea are performed as if the tea leaves were
there. Once an algorithm has been designed, it can be represented as flowchart, pseudocode or decision
table, which is further expressed in programming language to develop computer programs. Some desir-
able characteristics of algorithm are:
There must be no ambiguity in any instruction.
There should not be any uncertainty about which instruction is to be executed next.
The algorithm should terminate after a finite number of steps. An algorithm cannot be open-ended.
The algorithm must be general enough to deal with any contingency.
11. Define a flowchart. Give some advantages and disadvantages of using it.
Ans: A ‘flowchart’ is a pictorial representation of an algorithm in which the steps are drawn in
the form of different shapes of boxes and the logical flow is indicated by interconnecting arrows. The
‘boxes’ represent operations and the ‘arrows’ represent the sequence in which the operations are imple-
mented. The primary purpose of the flowchart is to help the programmer in understanding the logic of
the program. Therefore, it is always not necessary to include all the required steps in detail. Flowcharts
M04_ITL-ESL4791_01_SE_C04.indd 66 12/22/2012 4:53:45 PM
Computer Software and Programming I-67
outline the general procedure. Since they provide an alternative and visual way of representing the
information flow in a program, program developers often find them very valuable.
The advantages (or the reasons) of using flowcharts as a problem-solving tool are given as follows:
Makes logic clear: The main advantage of using a flowchart to plan a task is that it provides a pic-
torial representation of the task, which makes the logic easier to follow. The symbols are connected
in such a way that they show the movement (flow) of information through the system visibly. The
steps and how each step is connected to the next can be clearly seen. Even less experienced per-
sonnel can trace the actions represented by a flowchart, that is, flowcharts are ideal for visualizing
fundamental control structures employed in computer programming.
Communication: Being a graphical representation of a problem-solving logic, flowcharts are
better way of communicating the logic of a system to all concerned. The diagrammatical represen-
tation of logic is easier to communicate to all the interested parties as compared to actual program
code, as the users may not be aware of all the programming techniques and jargons.
Effective analysis: With the help of a flowchart, the problem can be analysed in an effective way.
This is because the analyzing duties of the programmers can be delegated to other persons, who
may or may not know the programming techniques, as they have a broad idea about the logic.
Being outsiders, they often tend to test and analyse the logic in an unbiased manner.
Useful  in  coding: The flowcharts act as a guide or blueprint during the analysis and program
development phases. Once the flowcharts are ready, the programmers can plan the coding process
effectively, as they know where to begin and where to end, making sure that no steps are omitted.
As a result, error-free programs are developed in HLLs and that too at a faster rate.
Proper testing and debugging: By nature, a flowchart helps in detecting the errors in a program,
as the developers know exactly what the logic should do. Developers can test various data for a
process, so that the program can handle every contingency.
Appropriate  documentation: Flowcharts serve as a good program documentation tool. Since
normally the programs are developed for novice users, they can take the help of the program docu-
mentation to know what the program actually does and how to use the program.
Flowcharts can be used for designing the basic concept of the program in pictorial form but cannot be
used for programming purposes. Some of the limitations of the flowchart are given as follows:
Complex: The major disadvantage in using flowcharts is that when a program is very large, the
flowcharts may continue for many pages, making them hard to follow. Flowcharts tend to get large
very quickly and it is difficult to follow the represented process. It is also very laborious to draw a
flowchart for a large program. You can very well imagine the nightmare when a flowchart is to be
developed for a program, consisting of thousands of statements.
Costly: Drawing flowcharts are viable only if the problem-solving logic is straightforward and not
very lengthy. However, if flowcharts are to be drawn for a huge application, the time and the cost
factors of program development may get out of proportion, making it a costly affair.
Difficult to modify: Due to its symbolic nature, any changes or modification to a flowchart usu-
ally requires redrawing the entire logic again, and redrawing a complex flowchart is not a simple
task. It is not easy to draw thousands of flow lines and symbols along with proper spacing, espe-
cially for a large complex program.
12. List some standard symbols used in flowchart with their description.
Ans: A flowchart is drawn according to the defined rules and using standard flowchart symbols
prescribed by American National Standard Institute (ANSI). Some standard symbols that are frequently
used for drawing flowcharts are shown in Table 4.3.
M04_ITL-ESL4791_01_SE_C04.indd 67 12/22/2012 4:53:45 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset