0% found this document useful (0 votes)
8 views184 pages

PLT Final Book

The document is a textbook titled 'Programming Logics and Techniques' authored by Er. Hari Pd. Bhandari, published in 2018. It aims to provide comprehensive knowledge on programming languages, software development, programming techniques, program maintenance, and client-server programming concepts. The book is structured into five chapters and includes objectives, important questions, and an index to facilitate learning for students in computer science programs.

Uploaded by

pravakarsilwal11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views184 pages

PLT Final Book

The document is a textbook titled 'Programming Logics and Techniques' authored by Er. Hari Pd. Bhandari, published in 2018. It aims to provide comprehensive knowledge on programming languages, software development, programming techniques, program maintenance, and client-server programming concepts. The book is structured into five chapters and includes objectives, important questions, and an index to facilitate learning for students in computer science programs.

Uploaded by

pravakarsilwal11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 184

A Text Book

of
Programming Logics
and
Techniques
[First Edition 2018]

Er. Hari Pd. Bhandari


Founder Principal (OCEM)

This book is dedicated to my father,


Late Tika Ram Bhandari

Published by:
A G EMENT
COLLE G E O

(AFFILIATED TO POKHARA UNIVERSITY)

COLLEGE OF ENGINEERING & MANAGEMENT


AN

EN
F

2000 AD
GINE &
ERING

Programming Logics & Techniques 11


Programming Logics and Techniques

Author : Er Hari Pd. Bhandari


Edition : First (2018)
Copyright : ©Author
Computer Setting : Nabin Shrestha
Printed by : Quality Press
Bharatpur, Nepal, 056-526701
ISBN No.: 978-9937-0-3666-5
Price : Rs. 545.00
Published by : Oxford College of Engineering and Management (OCEM)
Gaindakot Municipality-2, Nawalpur, State No-4, Nepal

All rights reserved


No part of this book may be reproduced in any form, by reprint, photostat, microfilm,
photocopy, or any other means, or incorporated into any information retrieval system,
electronics or mechanical, without the written permission of the author or publisher.

22 Programming Logics & Techniques


Preface
This is the age of information. The value of the information technology in the present world
can hardly be exaggerated. The use of computer and its application is never-ending. Those
who are unknown about this technology use feel uncomfortable to survive in this information
age in the current society. Therefore, the most valuable asset of any organization, no doubt,
is information. To cater with this need of the society, BCA program was first introduced in
Pokhara University in 2000 AD. Till then there was a concept in the society to learn computer
but not as an academic course. There was tendency to learn at training centers as short-term
courses for an operation. This concept was overcome slowly and it became known that without
including computer education even primary education is not possible and preferable. As a
result, almost all academic institutions have started offering regular courses on fundamental
computer like programming logics and techniques at all levels since then. This course deals
with necessary concepts of program development, operation and maintenance. Hence, we
realized that a good textbook that can cover these concepts in an orderly manner would
certainly be very useful for a very wide category of students and all types of computer users.
Keeping all these in mind, the present book has been written with two clear objectives,
i) to enable students to read this subject with required information, and
ii) to generate full of logics and techniques so that they can developed an effective and
efficient program.
Regarding the organization, the book consists of five chapters, all arranged in a coherent
manner. Chapter one is an introduction to language, types of programming languages with
there advantages and disadvantages. Chapter two explains the program development concepts
and tools required for it. Chapter three describes the programming techniques and methods
to develop a program with good performance and quality. Chapter four deals with program
development cost and maintenance cost as well. Lastly, chapter five explains the standalone
and client server programming and their application. Proper required diagrams are illustrated
with their advantages and disadvantages.
To make this book reader friendly, I have included objectives of each chapter just before the
unit start. At the end of unit very important long and short questions are incorporated which
make the learning more real and practical to interface the problems. Some of the important
model questions are incorporated at the end of the book. The book also includes an index and
some important list of abbreviations.
I hope this book makes the students, lecturers and readers more comfortable to understand the
subject matter due to the above-mentioned reasons.
Finally, I would like to request to provide valuable comments and suggestions which make the
books more preferable for the re-print.

Programming Logics & Techniques 33


Acknowledgment
I hope this book is preferable for all bachelor and master level students. The
inspiration of writing of this book has been initiated from the long history
of teaching and learning activities specially in Pokhara University colleges
(primarily Oxford College of Engineering and Management).

I would like to thank all the personalities and organizations who have supported
me directly and indirectly but most gratefulness goes to Mr. Binod Babu Paudel
who has edited this book thoroughly. Thanks also go to Mr. Nava Raj Gautam
for English corrections and suggestions. All the students who are studying at
Oxford College of Engineering and Management in BCA program deserve
thanks for their help to make this book student friendly.

I would also like to thank Mr. Nabin Shrestha for his beautiful design of inner
and cover pages.

I am highly grateful to all my department heads and seniors for their valuable
suggestions.

Finally, I can't remain contented without mentioning my better half Ms Ranjana


Bhandari and our two sons Rohan and Rohit Bhandari along with other family
members for their loving support and understanding during the entire period of
this long project.

44 Programming Logics & Techniques


Table of Content
1. Programming Languages 9-36
1.1 Introduction 10
1.2 Analogy with Natural Language 10
1.3 Classification of Computer Language 12
(Low Level Language and High-Level Language)
1.3.1 Low Level Languages, (Machine and Assembly Language)
1.3.2 Advantages and Disadvantages of Machine Level Language
1.3.3 Advantages of Assembly Language over Machine Level Language
1.3.4 Disadvantages of Assembly Language
1.4 High Level Language 18
1.4.1 Advantages and Limitations of High Level Language
1.4.2 Difference between Low Level and High-Level Language
1.4.3 Program Language Translator
1.4.3.1 Types of Translators (Compiler, Assembler and Interpreter)
1.4.3.2 Difference among Translators
1.5 Linker and Loader 23
1.5.1 Types of Linker and Loader
1.6 Generation of Computer Languages 26
1.6.1 3GL and 4GL
1.6.2 Advantages of 4GL over 3GL
1.6.3 Feature of 4GL (Object Oriented Language)
1.7 Some Important Types of High Level Language 30
1.8 Machine Independence and Portability of programs 34

2. Software Development (Program Development) 37-84


2.1 Introduction to program development/software development 38
2.2 Program Development Life Cycle 38
2.2.1 Problem Identification
2.2.2 Problem Analysis/Requirement Analysis
2.2.3 Program Design
Phases of Program Design (Data design, Input, Output, Procedure,
File design)
2.2.4 Program Coding
2.2.5 Program Testing and Debugging

Programming Logics & Techniques 55


2.2.6 Program Delivery/Implementation and Evaluation
2.2.7 Program Maintenance
2.2.8 Documentation
2.3 Programming Tools 59
2.3.1 Algorithm
2.3.2 Flowchart
2.3.3 Decision Table
2.3.4 Pseudocode
2.4 Comparison of Programming Tools 59-74
2.5 Advantages and Disadvantages of Programming Tools 59-74
2.6 Logics to Program Development 72
2.6.1 Types of Logics (Sequential, Selection Iteration and Recursion)
2.6.2 Differentiation
2.7 Symbols and some examples 75-82

3. Programming Techniques 85-121


3.1 Introduction 86
3.2 Type of Programming Technique (Approaches) 86
3.2.1 Modular, Top down, bottom up, Structured and Object-Oriented
approach
3.2.2 Advantages and Disadvantages
3.3 Program Development Methods (Models) 91
3.3.1 Types of Program Development Models (Water fall or Traditional
model, Prototype or Transformation model, Spiral model, Iterative
model, V-model, RAD model, Big-bang model, Evolutionary
models)
3.3.2 Advantages and Disadvantages of Waterfall, Prototype and Spiral
Models (Simple Introduction to other Models)
3.4 Cohesion and Coupling 113
3.4.1 Types of Cohesion and Coupling
3.4.2 Use of Cohesion and Coupling in Program Development
3.5 Communication between Modules 119
4. Program Maintenance 122-144
4.1 Introduction 123
4.2 Types of Program Maintenance (Corrective maintenance,
Adoptive maintenance, Perfective maintenance, Emergency
maintenance) 123
66 Programming Logics & Techniques
1 | Programming Language

4.3 Problem Areas in Program Maintenance 126


4.4 Cost Issues in Software Maintenance 126
4.5 Impact of Software Errors 126
4.6 Program Documentation and Its Standards 128
4.6.1 Requirements of Documentation
4.6.2 Importance of Documentation
4.6.3 Types of Documentation
4.7 Program Specification 131
4.8 System Flow Chart 131
4.8.1 Elements of System Flowcharts
4.8.2 Examples
4.9 Data Flow Diagram 134
4.9.1 Element of DFD
4.9.2 Labeling the data flow diagram
4.9.3 Idea for Drawing DFD
4.9.4 Examples

5. Standalone and Client Server Programming Concept 145-168


5.1 Introduction to Standalone Programming concept 146
5.1.1 Advantages and limitations of Standalone Programming
5.2 Introduction to Client Server Programming (CSP) 148
5.2.1 Advantages and Disadvantages of CSP
5.2.2 Distinguish between Standalone and Client Server Programming
5.2.3 Client Server Programming Architecture
5.5 Introduction to Web-based Programming 156
5.5.1 Advantages and Disadvantages of Web-based Programs
5.5.2 Architecture of Web-based Programming
5.5.2 Web-based System and Programming
5.6 Introduction to A Few Web based Languages and
Their Capabilities 164
5.7 Requirement of Platform-Independent System 167

Programming Logics & Techniques 77


1 | Programming Language

88 Programming Logics & Techniques


1 | Programming Language

Programming Languages
Unit-1

Objectives

This unit has following objectives:


1) To make the students aware of computer languages
types, features, advantages and disadvantages.
2) To make the students able to understand comparative
study of various generations of languages and their
capabilities to develop a good program.
3) To create a fair environment for students, how to translate
the source program into object and executable file.
4) To generate logical idea in the students for loading, linking
and relocating the program into the memory of computer
while compilation.
5) To apply the program skills on programming languages
with feature and ability.

Programming Logics & Techniques 99


1 | Programming Language

Computer Language
Language is the normal way humans communicate. Only humans use language, though many
other animals communicate in various ways.
Human language has syntax, a set of rules for connecting words together to make statements
and questions. Language can also be changed, by adding new words, for example, to describe
new things. Other animals may inherit a set of calls which have pre-set functions.
Communication may be made by speech or by writing or by moving the hands to make signs. It
follows that language is not just any way of communicating. Even some human communication
is not language: see non-verbal communication. Humans also use language for thinking.
Many definitions of language have been proposed. Henry Sweet, an English phonetician and
language stated: “Language is the expression of ideas by means of speech-sounds combined
into words. Words are combined into sentences, this combination answering that of ideas
into thoughts.” The American linguists Bernard Bloch and George L. Trager formulated
the following definition: “A language is a system of arbitrary vocal symbols by means of
which a social group cooperates.” Any succinct definition of language makes a number of
presuppositions and begs a number of questions. The first, for example, puts excessive weight
on “thought,” and the second uses “arbitrary” in a specialized, though legitimate, way.
The world is controlled through the flow of information. The information can be communicated
through various mediums like signals, sounds, music, certain key stocks (coding) etc.
Therefore, a language is the means of communication so that people can easily understand
the meaning. Hence, language can be called as system of communication.
A Language is system or means of communications. Language can be classified into 2 groups
in general sense: -
1. Natural Language 2. Computer Language

Natural Language
It is a means of communication used to communicate in between human beings. Some
examples of the natural languages are Nepali, English, French, German etc. Certain symbols
and letters form natural languages. These symbols and letters can be understood by human
beings, so means of communication is established at some points. The features of natural
languages are
1. It has large vocabulary.
2. Human beings use knowledge for the communication.
3. Energy consumption is different in different stage.

010
1 Programming Logics & Techniques
1 | Programming Language

Computer Language
It is a means of communication between a computer and an operator. This is also called
programming language. In computer language, certain commands or syntax or keystroke are
used to communicate in between the computer and the user. Some points: -
1. It has limited vocabulary as compared to natural language.
2. Computer can't think, so there is use of logic and ideas only.
3. Energy consumption during any stage is the same.
A programming language consists of all the symbols, characters and usage rules that permit
the user to communicate with computer. To learn a program, we have to learn all these
symbol and rules. There are many programming languages available and each one has its own
symbolic characters set and syntax but each language has an instruction set that permits those
operations to be performed.

Differences between Natural and Computer Language


There are some similarities between a natural language and a computer language but important
notable differences are tabulated which are given below:
Natural Language Computer Language
1. It has a very large vocabulary 1. It has a very limited vocabulary
2. It has certain rules and regulations 2. It has also certain rules and regulations
(grammar) to keep the set of symbols (syntax) of the set of instructions to be
and characters to make meaningful. understood by the computer
3. People can communicate the information 3. The communication is impossible if
if the rules are not strictly matched. rules are not correctly defined.
4. The means of communication occurs 4. The means of communication take place
from people to people. from people to the computer machine.
5. Except mother and national language, 5. Mostly, all the computer languages are
to study more languages is very difficult similar in their structure, so study is
due to the different rules and literature. comparatively very simple.
6. Human being use knowledge for the 6. The computer can't think so there is
communication. use of logic and ideas only.
7. Energy consumption is different at 7. Energy consumption during any stage
different stages. is same.
8. Examples are English, Nepali, Hindi, 8. Examples are high-level language
Chinese, German, French etc. (Fortran, Pascal, C, Dot Net, Java
etc.), Machine level and assembly
level language.

Programming Logics & Techniques 11


11
1 | Programming Language

Computer Program
The set of instructions, which is given to the computer in systematic manner to obtain specified
task in efficient manner, is called computer program.
A program is like a recipe. It contains a list of ingredients (called variables) and a list of
directions (called statements) that tell the computer what to do with the variables. The
variables can represent numeric data, text, or graphical images.
In another way a computer program is a list of instructions that tell a computer what to do.
Everything a computer does is done by using a computer program. A computer program is written
in a programming language.
There are many programming languages: BASIC, FORTRAN, COBOL, Pascal, C, C++,
Oracle, Java, and LISP are just a few. These are all high-level languages. One can also write
programs in low-level languages called assembly languages, although this is more difficult.
Low-level languages are closer to the language used by a computer, while high-level languages
are closer to human languages.

Types of Computer Language


Generally, there are so many kinds of computer languages, but they are grouped into two levels.
1. Low level Language
2. High-level Language

1. Low level language


This is a special kind of language used in the computer system in terms of coded format called
digits (0 and 1). The term "low" does not mean "inferior" in any sense, but rather "closeness"
to the way in which the machine has been built. Low-level language is not written in our
understandable format. The codes are the language of the PC. Therefore, it is also called
machine language. The machine codes are used to make means of communication between
computers and users e.g. 1001100111011.
The pulse format of 1101 is
1 1 1
0

2. High-level Language
This is some developed form of low-level language because low level language is in coded
format but high-level language is in our understandable format. Therefore, the written
program is systematic basic building of language syntax. A high-level language consists of a
set of words and symbols plus rules for using them to describe a problem or to describe the
procedures for solving a problem or doing the processing for an application. The language is
oriented toward the problem to be solved or procedures for solutions rather than the computer

212
1 Programming Logics & Techniques
1 | Programming Language

instructions. This language can't perform final result without help of middle language called
interpreter or compiler. Some examples of the high-level languages are C, Basic, Turbo C,
FoxPro, Fortran, VB.Net, Oracle, Java, PHP etc.

Difference between low level and high-level language


Feature High-level Language Low Level Language
Learning High-level Languages are very Low Level Languages are very difficult
easy to learn because there are to learn, because there are written in
written like simple English words. binary form or symbols form which are
called mnemonics. So, humans cannot
understand these things.
Understanding These Languages are near to Low level languages are far from
human languages and far from human languages and near to machine
machine languages. So, they are languages. So, they are not user
user friendly friendly.
Modification Programs in high-level languages Programs written in LLL's are very
and debugging are very easy to modify and debug. difficult to modify and debug.
Translation High-level Languages require No Translator is required in low level,
Translation. It cannot be used directly because it is written in binary code
without translating. Some examples or machine code and computer can
of translators are assembler, directly understand these languages.
interpreter and compiler
Execution Programs in H.L.L's are very Programs written in low level languages
slow in execution. are fast in execution, because they do not
require any translator. They are directly
executed in computer. So execution in
low level is faster than H.L.L's.
Uses These languages are especially These languages are normally used to
used for application programs. write hardware programs.
Flexibility High-level languages are flexible They are not flexible.
to read, edit, debug, understand.
Portability Programs can be copied from one Programs are different for different
computer to another computer. computers.
Machine It is machine independent. It is machine dependent.
dependent

Classifications of Low Level Language


There are mainly two kinds of low level languages they are:
1. Machine Language 2. Assembly Language.

Programming Logics & Techniques 13


13
1 | Programming Language

Machine Language
Machine language is the fundamental language of computer. It is similar to low level
language. Although computers can be programmed to understand many different computer
languages, this is the only one language understood by the computer directly without using
a translation program. It has only two levels upper and lower level indicated by 1's and
0's. These are called machine codes therefore binary number is called computer number
or machine number. The flow of information is called signal which computer can directly
understand and relay the information directly to the computer memory. So without interpreter
or compiler it gives the final result. In 1937 Claude E. Shannon had described the use of
Boole's symbolic logic and binary number in design of electrical calculators (Claude Elwood
Shannon (April 30, 1916 – February 24, 2001) was an American mathematician, electrical
engineer, and cryptographer known as "the father of information theory"). The use of binary
system was promoted for use in computer because any switching device like a switch, relay,
diode, transistors, and flip flop could have only two states of operations, ON (1) and OFF (0),
i.e. a binary state device.
A machine language would have two parts. The first is command or operation. Every Computer
has an operating code or opcode for each of its functions. It tells the computer what functions
are to be performed. The 2nd part of the instruction is the operand that tells the computer
where to find or store the data or other instructions that are to be manipulated. All the above
functions are directly controlled by the CPU.
Opcode Operand
(Operation Code) (Address/ Location)

Advantages of the Machine Language


• The main advantage of this language is that, it is faster in execution. So, it has high
efficiency.
• Translators are not necessary to convert the language.
• It can control the hardware components of the computer, so high security can be maintained.
• The handling of instruction for operation is simple because machine language is a one-
for-one language and in high level language instructions are easy to write and understand.
Disadvantages of the Machine Language
It has more disadvantages, which are discussed below.
1. Machine Dependent
Because of this nature, the internal design of every type of computer is different from
every other type of computer and needs different electrical signals to operate. The machine
language is also different from computer to computer, which is the main disadvantage of low-
level language. The cost of the hardware will be increased because of machine dependence.
2. Difficult to Program
Although easily understood by the computer, machine language is difficult to program.

414
1 Programming Logics & Techniques
1 | Programming Language

It is necessary to keep high memory to store machine codes and machine instruction set
which is practically more difficult to memories and has to refer the reference cards. A
programmer is also forced to keep the track of the storage location of data and instructions.
Therefore, a machine language programmer must be an expert who knows about the
hardware internal structure and its mechanism of the computer.
3. Error Prone (Occurs)
Writing a program is very difficult because it is necessary for the programmer to remember
the opcodes, track of storage data and instructions. It creates high possibility to generate
errors in the program.
4. Difficult to Modify:
To modify the errors in the program is very difficult for the programmer. Locating the
errors and correcting them is really tedious task, therefore programmers want to develop a
new program rather than correcting the errors in the old program. The programmer should
start the correction worth from the hardware part itself.
5. Time Consuming and Expensive
Although each instruction is simple, a very large number of them are required for
even the smallest program. As we know that it is difficult to write and modify the
program which takes more time for all.
6. Increase the Training Cost
Machine language requires a high-level of programming skill. This increases programmer’s
training cost.
7. Cumbersome (Weighty) process
Machine languages require programmers to control the use of each register in the
computer's Arithmetic Logic Unit. This is very cumbersome process perhaps comparable
to requiring automobile drivers to keep track of the firing order of their engines' cylinders.

Assembly Language
To reduce the programmer's burden, mnemonic operation codes and symbolic addresses were
developed in the early 1950s. One of the first steps in improving the program preparation
process was to substitute by letter or symbols-called mnemonics for the numeric operation
codes of machine language. A Mnemonic (memory aid) is any kind of mental trick. That is
used to provide metal help. In assembly language, mnemonics is used to represent operation
codes and strings of characters to represent addresses. As an assembly language is designed
mainly to replace each machine code with an understandable mnemonic and each address
with a simple alphanumeric string, it is matched to a particular computer's processor structure.
It is thus machine dependent. It is necessary for an assembly language programmer to know
all details of a computer's logical structures in order to write a program. It thus suffers from
many of disadvantages of machine language.

Programming Logics & Techniques 15


15
1 | Programming Language

In order to execute an assembly language program on a computer, it should first be translated


to its equivalent machine language program. This is necessary because the computer's circuitry
is designed to execute only the opcodes of the machine. The mnemonic operation codes
should be converted to absolute numeric opcode. The Symbolic address of operands used in
assembly should also be converted to absolute numeric addresses. The translator, who does
this, is known as an assembler. The input to an assembler is the assembly language program
and is known as source program. Its output is the equivalent machine language program and
is known as object program. The assembler is a system program, which is supplied by the
computer manufacturer.
A numeric or mnemonic is loaded into memory location so that the computer can directly
understand this with the help of converter. This converter is called assembler. In machine code
there is either 0 or 1, for this certain symbol or letter used with respect to certain alphabet.
Therefore, assembly language and machine language have similar nature but programmer can
write assembly program more easily than machine level language.
One example to write assembly language is stated below:
CLA A
ADD B
STA C
TYP C
HLT
Which would mean:- Take A, Add B, Store the result in C, Type C
And halt the computer.
Therefore, translating of assembly language into machine language will happen with the
certain converter, which is clearly explained by following figure:

Assembly Language Program Assembler Machine Language Program


(Source program) one-to-one (Object program)

The mnemonics and operation code of certain number are given in table
Mnemonics Address Memory location Opcode Meaning
HLT 1000 0000 00 End the program or stop the program
CLA 1001 0001 10 Take the value
ADD 1002 0002 14 add the value
SUB 1003 0003 15 Subtract the value
STA 1004 0004 30 Store the value
An assembly language is a low-level language as its translation to machine language is one-
to-one.

616
1 Programming Logics & Techniques
1 | Programming Language

Advantages of Assembly Language over Machine Language


The main advantage of assembly language is that the program written in it is easy to understand
as compared to machine language. Some of the important advantages of this language over
machine language are given below:
1. Easy Language
The program written in assembly language is more readable than machine level language.
Hence programmer can easily develop a program.
2. Easy to Locate the Mistakes (Errors)
The program written in assembly language is easier and locating the errors are also easier
than machine level language. For example, if in a program some mistake occurs to define
variable, it directly locates the error and displays not found error.
3. Easy to Modify the Mistakes
Once the mistake has been detected, then the errors can be easily corrected which is
comparatively easier than errors correction in machine language.
Writing a program in assembly language is more convenient than in machine language, it
is written in the form of symbolic instructions. Therefore, it gives a little more readability.
4. No Memory Address Problem
The additional memory location in the program is automatically managed, so there is no
problem in the addressing to the data.
5. Efficiency to Machine Language
It has more efficiency to translate the assembly code in to the machine level code because
the computer easily understands the assembly codes as compared to high-level language.
It translates the assembly instruction one by one.
6. Easily Re-locatable
The memory address in assembly language can be easily transferable. In other words,
using symbolic language, we can easily move program from one section to another section
of the memory address location.

Disadvantage of Assembly Language


1. Slower for Execution
A big drawback of assembly language is that they are machine-oriented, depending upon
the model of processor being used. Also, the program written in this language is slower to
execute as compared to those in the machine language.
2. Machine Dependent
Assembly language is specific to particular machine architecture. This language is
designed for specific task and model of a microprocessor. It means that assembly
language program written for one processor would not work on a different processor, if
it is architecturally different. That's way, the assembly language program is not portable
(machine dependent).

Programming Logics & Techniques 17


17
1 | Programming Language

3. Time Consuming
A machine (computer) can't execute an assembly language directly. This language has
to be translated first into machine (binary) language code after developing a program in
assembly codes, so the assembly language program is not as fast as the machine language.
4. High skilled Programmer
An assembly language programmer must be an expert who knows all about the logical
structure of the computer. So, program development is costlier.

High-level Language
This is a special kind of language where the limitations of low level languages are overcome
by introducing new system, called interpreter or compiler known as translator.
The development of mnemonic technique and macro-instruction led to the development of
high-level languages that are often oriented towards a particular class of problems.
In common sense, high-level language is written in English word (Natural Language) and
important mathematical symbols. Therefore, to write a program is very simple as compared
to other languages.
High-level language is not oriented to the machine based to solve the problem. Therefore,
programmer can easily identify as well as correct the errors.
Unlike assembly programs, high-level language programs may be used in different tasks
with little modifications. Thus, re-programming expenses may be greatly reduced when new
equipment is acquired.
High-level languages are also known as problem oriented languages because the micro
instructions are especially picked to be useful for routing particular class of problems and
may be completely useless for routing other types of problems. e.g. if a high-level language
is capable of handling business type application that consists of input volume relatively little
processing and a high output volume. Therefore, it is called business-oriented language. On
the other hand, this language is excellent at performing sophisticated or complex computation
but not adapted to handling large data files and is mathematical oriented language.
Some examples of high-level language are Basic, Fortran, COBOL, Pascal, PL/1 (Programming
language one), C, C++, VB.Net, Oracle, Java etc.

Advantages of High-level Language


Some of the advantages of high-level language are given below.
1. Machine Independence (Portability)
High-level languages are not related to the computer hardware components (Internal
structure of computer) because they are independent language. This is a very valuable
advantage because from computer hardware to hardware, software is not affected. This
language is portable i.e. programs could be run on different machines with little or no
changes.

818
1 Programming Logics & Techniques
1 | Programming Language

2. Easy to Learn and Use (Readability)


These languages are very similar to general English language and some of the familiar
symbols of mathematics which are daily used in our daily practice. Therefore, it is very
easy to learn and use. The programmer should not know many things about hardware
mechanism and organization of the computer. The programs written in these languages
are more easily readable than those in assembly language and machine language. So, it
requires less time to write and modify a program.
3. Less Error Detection
In case of high-level language, the programmer can write his/her program in general
language. Hence, getting of normal error is due to the case of misspelled and grammar.
They can be easily detected and errors are comparatively fewer than errors in machine
and assembly languages.
4. Easy Debugging
The detected errors are easily removed or debugged.
5. Economical (Software Development)
Writing a program in high-level languages requires less time and effort, which ultimately
reduce the cost of software development.
6. Better Documentation
Documentation is the manual of any system. So, the program developed in high-level
and the instructions written over it is simple. A high-level language is designed in such a
way that its instructions may be written more similar to the problem of general language.
Thus, the statement of program written in high-level language can be easily understood
by a normal person.
7. Easier to Maintain
High-level languages are very easy languages so that they are easier to understand and
hence it is easier to locate, correct and modify the instructions when we desire.
8. Reusable
The libraries of subroutines can be incorporated and used in many other programs. So,
they can be used as reusable modules.

Limitations of High-level Language


High-level language has mainly two types of limitations:
• Less Efficiency
A program written in machine or assembly language is more efficient than in the case
of high-level language. Low-level language program is directly related to the hardware
components of the computer. Therefore, they take less time and function with high
efficiency. But high-level language program at first has to be converted into machine code
rather than executed directly.

Programming Logics & Techniques 19


19
1 | Programming Language

• Lack of Flexibility
It has less flexibility as compared to low level language because the high-level language is
not directly related to the components of the computer. Therefore, flexibility of language
is reduced. Assembly and machine languages provide programmer access to all the special
features of the machine whereas this is not possible in the case of high-level languages.

Program Language Translator


A program written in high-level language is called source code. To convert the source code
into machine code, translators are needed.
A translator takes a program written in source language as input and converts it into a program
in target language as output.
It also detects and reports the error during translation.
Roles of translator are:
• Translating the high-level language program input into an equivalent machine language
program.
• Providing diagnostic messages wherever the programmer violates specification of the
high-level language program.

Different Type of Translators


The different types of translators are as follows:
1. Assembler 2. Compiler 3. Interpreter
All translators are system software.
1. Assembler
Assembler is a translator which is used to translate the assembly language code into machine
language code. The entire program written in high-level language has to be converted into
machine language. This can be done with the help of language processor. Hence the translators
are also called language processor.
Assembly Machine
language Assembler language
code code
              
2. Compiler
Compiler is also a translator. It is much more sophisticated than an assembler and translates
a source program, which are usually written in high-level languages, into machine language.
The compiler is capable of replacing single source program statement with series of machine
languages or instructions. A program written by a programmer in HLL is source program.
The converted source program into machine language by compiler is called object program.
Source program and object program are the same program, but at different stages of develop-
ment. The compilers are different for different program.
020
2 Programming Logics & Techniques
1 | Programming Language

E.g. a Fortran compiler is only capable of translating source program, which have been written
in Fortran. Moreover, since an object program for one machine will not be the same as the
object program for another machine, it is necessary that each machine must have its own
specific compiler for particular language.

Source Program Input Output Machine Language


Compiler
(High-level Language)

Program P1 in high-level language L1 Compiler for language L1 Machine code for P1

Program P2 in high-level language L2 Compiler for language L2 Machine code for P2

A Compiler creates a unique object program when a source program is compiled. There is no
need of the source program code. Output can be obtained by executing that object program.
During the process of translation, the compiler reads the source program statement-wise or
block-wise and checks the syntax (grammatical) errors. It can't check logical error. If there
is any error, the computer generates a printout of the error it has detected and this action is
known as diagnostic.
For whole error debugging compiler is faster than interpreter. Compilers are large programs,
which reside permanently on secondary storage. When the translation of a program is to be
done, they are copied into the main memory of the computer. The compiler being a program
is executed in the CPU.
         
3. Interpreter
An interpreter is also a translator, which translates high-level language into machine code. It
translates each source program statement into a sequence of machine instructions and then
executes the machine instructions before translating the next source language statement.
Interpreter translates line by line and reports the error once it encounters during the translation
process.
It directly executes the operations specified in the source program when the input is given by
the user.
It gives better error diagnostics than a compiler.
Source Program
Interpreter Output
Input
Interpreters are also unique for each high-level language. Basically, the function of an
interpreter and a compiler are the same. The only difference is that a compiler provides a
separate object program whereas in an interpreter no object code is saved for future use. It
must once again be interpreted and translated into machine language every time the source

Programming Logics & Techniques 21


21
1 | Programming Language

program is needed. Here line-by-line execution takes place and if it finds error in any line then
stops or it wouldn't execute the next line unless the first one has no error.
Interpreters are often employed with microcomputer (small computers). The advantage of an
interpreter over a compiler is fast response to change in the source program.
Interpreters are easy to write and they do not require large memory space in the computer. The
interpreter, however, is a time-consuming method because each statement must be translated
every time it is executed from the source program. Thus, a compiled machine language
program runs much faster than an interpreted program.

Difference between the Translators


The following table shows the difference between the translators.
Compiler Interpreter Assembler
1. It scans the entire program 1. It translates the program 1. It also converts the
first and translates it into line by line. entire program into
machine code. machine codes.
2. It converts the entire 2. Each time the program 2. Same as compiler
program to machine code; is executed; every line is
when all the syntax errors checked for syntax errors
are removed, execution and then converted to
takes place. equivalent machine code.
3. Slow for debugging 3. Fastest for debugging. 3. Faster for debugging.
(removal of errors from a (Very fast to identify the
program) errors into the program)
4. Overall execution time is 4. Overall execution time is 4. Overall execution
less more. time is higher than
interpreter.
5. It creates only one object 5. It does not create object 5. It creates only one
program after execution program. object program after
of program. execution of program.
6. It is Separate for separate 6. It is Separate for separate 6. It is Separate for
programs. programs. separate programs.
7. It translates high-level 7. It translates high-level 7. It translates assembly
language into machine language into machine level language
level language. level language. into machine level
language.
8. Programming languages 8. Programming languages 8. File: Motorola 6800
like C, C++ uses compilers. like Python, BASIC, and Assembly Language.
Ruby uses interpreters. png

222
2 Programming Logics & Techniques
1 | Programming Language

Linkers and Loaders


They are separate programs which do nothing but read the program into memory. This type of
program is called a loader. A loader reads (loads) a program from an input device into memory
for execution. It is normally the responsibility of the operating system to load and execute
files. The part of the operating system that performs this function is called a loader. Loader
and linker are the important part of any translator. For translating the source program there are
certain activities happening into the memory which is called loading and linking.

Loader
Source Object Executable Data Results
Translator Linker Execution
Program Program
Code Relocator

It is clear from the above figure that loading and linking processes occur simultaneously.
The function of the loader is to read object codes and load them into memory specified by the
assembler.
Loader
It is responsible for loading, linking and relocation. The basic functions of the loader are as
follows:
• To assign a load time storage area to a program - storage allocation.
• Making a program to execute properly from its load time storage area - program
relocation.
• Keeping the program into assigned memory area - loading.
• Linking of programs with one another-linking.
In another way, the basic function of the loader can be explained as:
• Allocation: The space for program is allocated in the main memory, by calculating
the size of the program.
• Loading: Bring the object program into memory for execution.
• Relocation: Modifies the object program so that it can be loaded at an address different
from the location originally specified.
• Linking: Which combines two or more separate object programs and supplies the
necessary information.

Types of Loaders
Absolute Loader
The absolute loader is the simplest and quickest type of loader. This loader is a primitive type
of loader that executes only the loading function. It loads the object program from translation
time address and simply transfers control to it. The loader loads the file into memory at the
location specified by the beginning portion (header) of the file, then passes control to the

Programming Logics & Techniques 23


23
1 | Programming Language

program. If the memory space specified by the header is currently in use, execution cannot
proceed, and the user must wait until the requested memory becomes free. It doesn't perform
linking and program relocation.

Bootstrap Loader
A bootstrap loader is a computer program that loads the main operating system into the RAM
of the computer through ROM. When the computer is turned on, absolute loader is executed.
This loader is responsible for loading the operating system and transferring control to it. The
bootstrap loader is present in the ROM area of main memory.

Re-locatable Loader
This loader is responsible for relocation and loading. The relocating loader will load the
program anywhere in memory, altering the various addresses as required to ensure correct
referencing. It is some time also known as direct linking loader.

Linker (Software, Part of translator)


Linker (computing) is a computer program that takes one or more objects generated by a compiler
and links them to standard library function and hence making them executable program:
• GNU linker (Gnus Not Unix), the classic GNU Project's implementation of the Unix
linker command ld
• Gold (linker), rewritten linker implementation in GNU Project.
• Dynamic linker, the part of an operating system that loads and links the shared
libraries for an executable program.
The linker establishes the linking-relationship between software and hardware. Linker is a
program that does the merging of individual program modules so that they could communicate
with each other.
All the high-level languages are using in-built functions like calculating square root, sine,
cos etc. The programmer doesn't code these functions but the standard library of the high-
level language provides these functions. During the process of execution, this higher-level
language program should be co-resident in the main memory along with the programs for
these functions. Whenever the high-level language program invokes these functions, the
control gets transferred to the appropriate program. The linking function makes the addresses
of these programs known to each other so that such control transfer could be affected during
execution.
The linker does the process of linking of the software with hardware to perform specialized
work with the reference existing operating system. For example, the compilation process of C
program is shown in figure below;

424
2 Programming Logics & Techniques
1 | Programming Language

Compiler Assembler
Source Pre-processed Assembly Object
Program source code code code
Pre-processor Linker

Executable
code

Process Program stored in


Address secondary memory
Space Loader as executable image

Main Memory
Fig.: Compile of process of C program

Type of linker
Linking Loader
The linking loader performs all linking and relocation operations and loads and linked program
directly into the main memory for execution. The functions can be pointed as:
• Shifting the instruction to the brain of the computer.
• Relocating – Managing the instructions.
• Storing into main memory.

Linking Editor
After storing the information into main memory, it is checked for correction. A linkage editor
produces a linked version of the program called the Load Module or an Executable Image.
This load module is written onto file or library for execution at a later stage.

Dynamic Linker
The total duration of the program execution is the dynamic period. This scheme postpones
the linking function until execution time. Any subroutine is loaded and linked to the rest of
the program when it is first called. This type of linking is called dynamic linking, dynamic
loading or loads on call.

Programming Logics & Techniques 25


25
1 | Programming Language

Difference between Linker and Loaders


Basis for
Linker Loader
Comparison
Basic It generates the executable It loads the executable module to the
module of a source program. main memory.
Input It takes as input, the object code It takes executable module generated
generated by an assembler. by a linker.
Function It combines all the object It allocates the addresses to an
modules of a source code to executable module in main memory
generate an executable module. for execution.
Type/Approach Linkage Editor, Dynamic linker. Absolute loading, Relocatable loading
and Dynamic Run-time loading.

Generation of Programming Languages


As we study the generation of the computer; similarly, the development of the computer
languages continuously occurred and a system was achieved called the generation of
programming language. Programming dates back to Lady Ada, the countess of Lovelace
and daughter of Lord Byron, the famous English poet. She is taken as first programmer as
she conceptualized the idea of programming while working with Lord Charles Babbage on
computer science during development of analytical engine.
The development of programming languages can be distinctly divided into four generations.
First generation of Language (1GL) (1940 to 1950) Machine Code/Language
Second generation of Language (2GL) (1950 to 1958) Assembly Code/Language
Third generation of Language (3GL) (1958 to 1985) Procedural Language
Fourth generation of Language (4GL) (1985 to onwards) Non-procedural Language

Generation of High-level Languages


Hence the generation of high-level language is divided into two groups.
Third Generation of Language (3GL) (1958 to 1985) Procedural Language
Fourth Generation of Language (4GL) (1985 to onwards) Non-procedural Language

Third Generation of Language (3GL)/Procedural Programming Language


The Procedure Oriented Languages initially were introduced in the 1950s. They were seen
primarily in relation to assembly languages. A procedural language is a type of computer
programming language that specifies a series of well-structured steps and procedures within
its programming context to compose a program. It contains a systematic order of statements,
functions and commands to complete a computational task or program. Procedural
programming, also called imperative programming, features an orderly flow of control

626
2 Programming Logics & Techniques
1 | Programming Language

through the program, starting at the top and continuing through till the end. When you need to
carry out a discrete task, especially one that might be carried out multiple times, you pass the
control to a function, which does a specific set of actions, and then returns a value. Examples
of procedural languages include BASIC, Pascal, and C, although there are many others.
A procedural language is also known as imperative language.

Characteristics of Procedural Language


1. Emphasis is given on doing the things or procedure (i.e. in stepwise order like algorithm
and flowchart)
2. Large programs are divided into smaller programs known as functions.
3. Most of the functions are inter-related to the global data of a program.
4. Data are more openly around the system from function to function.
5. Function forms data from one form to another.
6. It has top to bottom approach to execute the program to design the program.

Characteristics of OOPs (Object Oriented Programming System)


1. The emphasis is on data rather than procedure.
2. Programs are divided into different blocks consisting of data and function as the program
statement, this is known as object.
3. Data structure is designed such a way that they behave like an object.
4. Functions that operate on data of an object are tied together in the data structure.
5. Data is hidden and can’t be accessed by external function. Therefore, it has better security
system.
6. Objects may communicate with each other through function.
7. New data and functions can be easily added and modified whenever necessary.
8. It follows the principle of bottom to top approach in the program.

Fourth Generation of Language (4GL)/Object Oriented Programming


Language
A fourth-generation programming language (1970s-1990) (abbreviated 4GL) is a programming
language or programming environment designed with a specific purpose in mind, such as
the development of commercial business software. In the evolution of computing, the
4GL followed the 3GL in an upward trend toward higher abstraction and statement power.
The 4GL was followed by efforts to define and use a 5GL. The natural-language, block-
structured mode of the third-generation programming languages improved the process of
software development. However, 3GL development methods can be slow and error-prone.
It became clear that some applications could be developed more rapidly by adding a higher-
level programming language and methodology which would generate the equivalent of very
complicated 3GL instructions with fewer errors. In some senses, software engineering arose
to handle 3GL development. 4GL and 5GL projects are more oriented toward problem solving
and systems engineering.

Programming Logics & Techniques 27


27
1 | Programming Language

Most of 4GL languages are used to get information from file and database. Therefore, most
of the database software belongs to this group such as ORACLE, ORACLE developer 2000,
FoxPro for windows etc. They are SQL languages. Simply it is sequential query language or
sometimes it is also known as structured query language.
Many 4GLs are associated with databases and data processing, allowing the efficient
development of business-oriented systems with languages that closely match the way domain
experts formulate business rules and processing sequences. Many of such data-oriented 4GLs
are based on the Structured Query Language (SQL), invented by IBM and subsequently
adopted by ANSI and ISO as the standard language for managing structured data.
Most 4GLs contain the ability to add 3GL-level code to introduce specific system logic into the
4GL program. The most ambitious 4GLs, also denoted as Fourth Generation Environments,
attempt to produce entire systems from a design made in CASE tools and the additional
specification of data structures, screens, reports and some specific logic..
DDL and DMLs may be either free standing or embedded in another language. The combination
of DDL and DML is often called a Data sub language (DSL) or even a just query language.
DDL - Data Description Language – used to specify database
DML - Data Manipulation Language – used to access data
The 4GL languages are used to develop various kind of application development softwares.
They are
a. Personal computer application software
b. Query languages and report generation
c. Decision support systems and financial planning languages
d. Application generators
Personal Computer Application Software
The personal computer application softwares like word-processing, spreadsheets, database
managers, business application etc. can be easily developed using 4GL. Using these tools, we
can solve our own problems.
Query Languages and Report Generation:
The query languages and report generating software can be prepared using 4GL. They are
mostly used to search the record from the database server. This group of software is mostly
used in business houses, railway, airlines, bus etc. ticket reservation. Some common query
and report generation languages are QBE, SQL, HAL, Answer/Database, PDQ, INQUIRE,
QMF, PRG III etc.
Decision Support Systems and Financial Planning Languages
This group of software is used to analyse the decision made by the decision support group
of the financial and planning sectors managers. The strong mathematical, statistical and
logical analysis decision is necessary during this period. Some examples of this software are
Application System, Command Center, Express, FCS, and System W etc.

828
2 Programming Logics & Techniques
1 | Programming Language

Application Generators
This software section meets the requirement of the application users. According to the
user requirement, the module of the program can be generated. The various module of the
program is developed and based on the application. The required module of the program can
be selected. Some examples of the application generators are FOCUS, INGRESS, MARK V,
TELON, UFO etc.

Features of 4GL
A 4GL may be regarded as being very high-level language whose features and characteristics
are same as OOPS languages, which provide simple and powerful ways for the user to do
such things as:
• Define Data
• Define what processing must be performed on the data.
• Define report or screen-form layouts including the formats of printed or displayed data.
• Define the processing operations to be carried out in the preparation of report or in the
user’s interaction with screen base forms.
• Define input data and validation checks.
• Select combinations of standard processing operations.
• Handle user varies.
• Depending upon the way in which the 4GL have been designed, it may either be used by
the end user directly or used by a computer specialist to “build” an end-user system.
• Thus, the 4GL either works by tailoring a generalized piece of software to handle a
particular application or by using a general set of software tools to construct a particular
application system.
• 4GL can be used to build prototypes of new systems as well as for building in the right
way.

Difference between 3GL and 4GL


The difference between Third and Fourth Generation of languages:

3GL (Procedural Language) 4GL (Non-procedural language)


1. It stands for Third Generation Languages 1. It stands for Fourth Generation Languages
(3GL) or procedural language (4GL) or non-procedural language
2. The stepwise set instructions are written 2. Requirement oriented instructions are
written
3. It requires large number of procedural 3. It requires very few instructions so
instructions which create complexity overall work would be simple.
for understanding and maintenance of
the program

Programming Logics & Techniques 29


29
1 | Programming Language

4. Language developed for batch operation. 4. Language developed primarily for on-
line operation.
5. Can be difficult to learn 5. Easy to learn
6. Difficult to debug. 6. Easy to debug.
7. Typically file-oriented. 7. Typically database-oriented.
8. All alternatives must be specified in the 8. Default alternatives are built in; an end
program user need not specify these alternatives.
9. Requires specification of how to 9. Requires specification of what task is to
perform tasks. be performed (system determines how
to perform the task)
10. Professional programmers are needed to 10. May be used by a non-programming
operate the program end user as well as a professional
programmer.

Some Examples of High-level Language


Under the basis of time period and development of programming efficiency, there are various
kinds of high-level languages. Initially the concept of compiler was developed by Dr. Grace
Hopper. He gave the concept of high-level language as early as 1952 (started in 1942 but
succeeded in 1952). Under his directions two languages were developed which were only
supporting of high-level language.

• Flow-Matic
FLOW-MATIC, originally known as B-0 (Business Language version 0), was the first
English-like data processing language. It was developed for the UNIVAC I at Remington
Rand under Grace Hopper during the period from 1955 until 1959. It had a strong influence
on the development of COBOL. This was a commercial and business language, which could
easily be put together from contents of flowchart.
First, FLOW-MATIC was the first programming language to express operations using English-
like statements.
Second, FLOW-MATIC was the first system to distinctly separate the description of data from
the operations on it. Its data definition language, unlike its executable statements, was not
English-like; rather, data structures were defined by filling in pre-printed forms.

• Mathematics
This was a mathematical language used for mathematics purpose.
After this, many other high-level languages have been produced. Today there are over 200
high-level languages. Some of them are:

030
3 Programming Logics & Techniques
1 | Programming Language

1) Logo (Procedural Language/3GL)


Logo is an educational programming language, designed in 1967 by Wally Feurzeig, Seymour
Papert and Cynthia Solomon. Specially, Logo was developed by Seymour Papert who was
a teacher in U.S.A. He designed this language so that children could learn computers by
drawing pictures. It is used for graphical purpose for drawing lines square but not image or
complex graph. This is also called a graphic language.
The usage of LOGO is based on a friendly little animal called the turtle. It is the name given to the
LOGO cursors. It looks like a small triangle. The turtle has a head, which is the upper tip of the
triangle. It can be tumid around its center in all directions and it can also move forward and backward.
2) Fortran (Procedural Language/3GL)
One of the oldest programming languages, the FORTRAN was developed by a team
of programmers at IBM led by John Backus, and was first published in 1957. The name
FORTRAN is an acronym for FORmula TRANslation, because it was designed to allow easy
translation of math formulas into code.
FORTRAN was the first high-level language, using the first compiler ever developed. The
language was designed to solve scientific and engineering problems which is the most popular
language among scientists and engineers. The main feature of FORTRAN is that it can
handle complex numbers very easily. But the syntax of FORTRAN is very rigid. FORTRAN
language is not suitable for a large amount of data, so it is not used for business programming
application with the evolution of better computers and with increasing maturity of users,
Fortran's also developed. The first version that was extensively used in late 50's and early 60's
was FORTRAN '77. FORTRAN '95 has been standardized which has incorporated features to
write programs for parallel computer.
Although the current standard is Fortran 2008, even many of those features first introduced
into Fortran 2003 are still being implemented. The additional features of Fortran 2003 and
Fortran 2008 are described by Metcalf, Reid and Cohen.
3) COBOL (Procedural Language/3GL)
COBOL stands for Common Business Oriented Language and is one of the popular languages
used for business application. COBOL is suitable for processing large volume of data and
several reports can be generated using COBOL based on stored data.
COBOL (Common Business-Oriented Language) is a high-level programming language
for business applications. It was the first popular language designed to be operating
system agnostic and is still in use in many financial and business applications today. COBOL
programs are characterized by their easy readability due to their verbose syntax and good
data organization and file handling. Due to its similarity with English, COBOL programs are
easy to read and write. Thus, people in business, who rely on computer output but have no
computer expertise, can understand the program written in COBOL. That's why it is called a
self-documenting language, which is self-explanatory.

Programming Logics & Techniques 31


31
1 | Programming Language

The work on the language began in 1959 with strong support from the United States
department of defense under the guidance and command of Grace Murray Hopper. The
maintenance and further orderly growth of the language was handed over to a group called
CODASYL (conference on Data Systems Language). The first formal COBOL report was
published in 1960 and revised in 1965.
The version was gradually improved, ANSI standardized COBOL in 1968, 74 and 84. Object
oriented version of COBOL has recently (1997) appeared in the market. COBOL is a widely
used Programming language for business data processing. It is not used for general purpose
and scientific purpose. It is lengthy type of program.
A COBOL program is divided into 4 parts or divisions. These divisions describe 4 main
aspects of a program and are called Identification Division, Environment division, Data
division and procedure Division.

4) BASIC
Basic stands for Beginners All-purpose Symbolic Instruction Code. It was developed at
Dartmouth College, U.S.A in 1963 by Dr. John G. Kemeny and Thomas E. Kurtz. It is the
most popular computer language, which is used for general purpose. The language is designed
for a beginner and can be learnt quickly. As the Program is entered, it is checked by syntax
errors, which can be immediately corrected. The translator for BASIC is thus interpreter.
BASIC is available on all personal computer and even in some pocket computers. The main
characteristic of BASIC is to handle both mathematical and business problems. It can be used
for creating sound graphics. This language is easy to understand but the main problem is that
most versions of this language do not support indexed file. Some versions are Apple BASIC,
Ting BASIC, GWBASIC, and QBASIC. It is procedure language that we give information
step by step. QBASIC has its self-compiler and has hanging menu driven system. QBASIC is
more advanced than GWBASIC.

5) PROLOG
PROLOG stands for programming in LOGIC. It was developed in France in 1972. It is
very popular in Japan where it is adopted as the official programming language for the fifth-
generation computers.
Prolog is a general-purpose logic programming language associated with artificial intelligence
and computational linguistics.
Prolog has its roots in first-order logic, a formal logic, and unlike many other programming
languages, Prolog is declarative: the program logic is expressed in terms of relations,
represented as facts and rules. A computation is initiated by running a query over these
relations.
The language was first conceived by a group around Alain Colmerauer in Marseille, France,
in the early 1970s and the first Prolog system was developed in 1972 by Colmerauer with
Philippe Roussel.
232
3 Programming Logics & Techniques
1 | Programming Language

As the name suggests, PROLOG lays stress on the usage of logic to solve problems. We
can simply say that it is a logical language and the system is controlled through logically.
It is basically known as a theorem-proving system, using a formal logic technique known
as predicate calculus to prove the truth of propositions. Programmers avoid the usage of
PROLOG because we feel that it does not offer flexibility. It is a conventional language.

6) PASCAL
PASCAL is a programming language named after Blaise Pascal, the famous French
mathematician who built one of the early calculating devices in 1642. This language was
designed by Prof. Niklaus Wirth in 1970 at Eidgenossisehe Technisehe Houcheshule (ETH)
in Zurich, Switzerland. With the primary aim of providing a language which helps beginners
to learn good problem solving and programming methods, the 1st report on the language
appeared in 1971 and report describing the language with its improvements appeared in
1972-73.
PASCAL is a general-purpose language that can be used for a wide range of numeric and
non-numeric applications. Pascal is an imperative and procedural programming language.
It is like C language. There is 90% similarity. So, we can say that C is developed form of
PASCAL. 90% of command of C can be used in PASCAL.
PASCAL has been standardized by International standards organization (ISO) and ANSI. It
has facilities to manipulate not only numbers, but also vectors, matrices, strings of characters,
sets, records, files and lists.

7) C Language
C was developed by Dennis Ritchie in 1972 in Bell Telephone laboratories in U.S.A.
C has been defined so that it has the advantage of high-level language, namely, machine
independence. C is a general-propose structured programming language. It is characterized by
the ability to write very concise source programs. The compiler of C is commonly available
for the computer of all sizes. The compilers are usually compact and they generate object
programs that are small and highly efficient as compared to the programs written in any other
language. C was the modified versions of two earlier languages BCPL and B, which were also
developed at Bell Laboratories.
The 1st major use of C was to write an operating system known as UNIX. The current popularity
of C is due to its efficiency and its connection with UNIX. An aspect of C, which makes it a
powerful programming language, is the access it provides to the addresses in memory where
variables are stored. These addresses are known as pointers. The access to pointers and the
operations which can be performed with pointers is what distinguishes C from other high-
level languages, such as FORTRAN and COBOL. Pascal does provide pointers but restricts
their use. The main disadvantage of C, particularly for a beginner, is its conciseness and
extensive use of pointers.

Programming Logics & Techniques 33


33
1 | Programming Language

8) C++ Language (1980)


It is a developed version of C called as c ++ (pronounced as "C plus plus")
Object oriented language, invented in 1980 by Dr. Bjarne stroustrup at Bell. Lab, it has
undergone two major revisions, one in 1985 and another in 1990 and is still developing and
evolving.
C++ contains all the elements of the basic C language but has been expanded to include
numerous object-oriented programming features. It enhances input/output system, function
overloading and the class/object mechanism.
• C++ being a superset of C is an extremely efficient language.
• It has a mechanism to hide variables from unauthorized access (security)
• It has the feature of reusability.

9) JAVA (1998)
Java is a language primarily used for internet-based applications. Its development started at
Sun Microsystems. It was lead by Programmer James Gosling.
1995/96 - 1st version (Concept)
1997 - Modified version.
1998 - 1.2 Java (full version)
It was developed to overcome the complex terms and hypothesis of C++. It has following
features:
The compiled code should be machine-independent (recall that the compiled code of other
high-level languages is machine dependent).
The developed programs should be simple to implement and use even in consumer electronics
products like TV set-top boxes, hand-held devices, telephones and VCRs.

Machines Independent and Portability of a Program (Machines


Independent)

All the high-level languages are machine independent languages because they are not directly
related to the internal architecture of a computer. The low-level language is called machine
dependent language because they depend on computer architecture to architecture.
All high-level languages are problem oriented languages i.e. they reflect the type of problem
solved rather than the features of the machine. Source programs are written in statements
similar (akin) to English, a great advance over mnemonics of assembly language. Each and
every high-level language are not physically dependent. It means no one high-level language
is based on internal hardware part and the manufacturing principle. Whatever the hardware
development occurs on basic memory (RAM and ROM), CPU, cache memory, VGA/AGP,

434
3 Programming Logics & Techniques
1 | Programming Language

Data-bus memory, Dynamic (DRAM) as well as RPMS (Revolution Per Minutes), there is
no great impact to the language. Specially, high-level language may depend on capacity of
computer to load the software into the memory. Even though the claims for transferability
or portability of programs and programmer training are sometimes exaggerated, since the
languages implemented by different manufacturers are not really identical. A few differences
can be explained by machine differences, but beyond that there is a great temptation for every
implementation to add extra features that are considered desirable. These features, regardless
of how valuable they may be detracted from the ability to move a program or a programmer
to another installation that uses a different system.
High-level language is machine independent which is one of the very important features of
high-level languages

Portability
Due to the above various features of the high-level language, program can be very easily
transferred from one type of computer configuration to another type of computer configuration.
Portability in high-level computer programming is the usability of the same software in different
environments, so that the market availability and flexibility of the program will highly increase
and hence price of program will decrease. Therefore, high-level language has more portability.
The program transferable feature is called portability of a program. (High efficiency)
Software portability may involve:
• Transferring installed program files to another computer of basically the same architecture.
• Reinstalling a program from distribution files on another computer of basically the same
architecture.
• Building executable programs for different platforms from source code; this is what is
usually understood by "porting".

Programming Logics & Techniques 35


35
1 | Programming Language

Questions
Solve the following questions. (each question carries 7/8 Marks)
1. What is natural language? “high level language is better than low level language”. Justify
this statement.
2. Define programming language. List out the advantages and disadvantages of high-level
language.
3. What is interpreter? Differentiate between compiler and interpreter
4. Define 4GL. Explain the use of 4GL with its merits and demerits.
5. Explain the computer programming language generations with classification diagram.
6. What are the functions of language processor? Compare and contrast compiler and
interpreter with functional diagram.
7. What is a linker? Explain the need of machine independence and portability of programs.
8. Discuss the need of loader and linker. Is it essential for a programming language to
attain machine independence? Justify you answer with reference to some well-known
programming language.

Write Short notes on the following: (each question carries 5 marks)


a. Natural programing Language (NPL)
b. Need of Platform independent program
c. Decision Table
d. Flow Chart
e. Pseudocode
f. Decision Tree
g. Algorithm
h. Machine Language
i. High Level language
j. Assembly Language

636
3 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Program/Software Development
(Specification) Unit-2

Objectives
This unit has following objectives:
1) To give conceptual knowledge to the students for program
development
2) To analyze the program developing steps through program/
system development life code
3) To create general idea to students for tentative budget
requirement to develop a program.
4) To generate good programming skills and logics through
programming tools (Algorithm, flowchart, decision table,
pseudo code etc).
5) To develop overall creative, logical and analytical thoughts
for basic requirement and steps to make effective and
efficient program development.

Programming Logics & Techniques 37


37
2 | Program/Software Development (Specification)

Introduction to Program Development


What is a program?
A program is a group of instructions set together to obtain specified output after supplying the
input information to the computer in systematic order. We can also say that, if the algorithm
is written in the computer language then the set of instructions is called a program. Hence
it is concluded that a computer cannot do anything on its own. It must be instructed to do a
required task. So, it is necessary to specify a sequence of instructions that a computer must
perform to solve a problem. Such a sequence of instructions written in a language that can be
understood by a computer is called a computer program.

To Develop the Program


Different types of concepts about the program should be considered to develop an efficient
program. A good program only comes from good program design and good design only comes
from giving sufficient thought and effort in the early stages in the programming. Therefore,
before developing a program, the programmer should study about the following two points.
They are :
• System development life cycle,
• System security

System Development Life Cycle


SDLC stands for System Development Life Cycle. It is a step-by-step process. It is an organized
way of developing successful systems. It improves the quality of a system. SDLC consists of
different phases. This is the total time period or life period of a program as well as how long
it would be stable into the market. Every system has a life cycle, like that the human beings,
plants, new products etc. This is called system development life cycle or life period of the pro-
gram. The system development life cycle covers all the following terms of the system. What
is the problem? Feasibility study, Analysis, Design, implementation, post-implementation and
maintenance, considerations for candidate's systems: political considerations, planning and
control for system success, prototyping etc. Generally above points of system life cycle are
categorized into following stages.
• Preliminary Investigation (Need of New System)
• Problem identification study
• Feasibility study
• System analysis
• System design
• System development and its construction
• System testing and debugging
• System conversion
• System Implementation
• System Evaluation, Maintenance and Monitory
838
3 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Start

Preliminary
investigation
Re-development Feasibility
Study

System Evaluation System


Requirement and
System System Analysis
Maintenance

System Conversion
or Implementation System Design

System Testing
and Debugging System
Development

Fig.: SDLC

Preliminary Investigation
Preliminary investigation is the first phase. In this phase, the system is investigated. The
objective of this phase is to conduct an initial analysis and findings of the system. The
following stages are studied in this phase. The main aim of preliminary analysis is to identify
the problem. First, need for the new or the enhanced system is established. Only after
the recognition of need, for the proposed system is done then further analysis is possible.
Preliminary investigation can be called understanding of problem/problem definition/system
concept/system study/preliminary analysis/initial investigation etc.
The programmer or system analyst can only develop the program, if he/she is familiar about
the candidate system or program. Therefore, the following two initial points about the program
development are very important.
Programming Logics & Techniques 39
39
2 | Program/Software Development (Specification)

- The system analyst or programmer must exactly know what we are trying to do.
- The system analyst or programmer must have working experience about the project
so that he/she confirms about how the task should be done.
For example, if you want to develop a program of the library, then you must understand about
the library management system. That is order-keeping system, book keeping system, book
issuing system, book analyzing system etc. In this case, the user and programmer must know
about the pattern of the problems and their probable solutions. Hence, it is also known as
problem definition. Problem identification is also the similar concept, but users and system
analysts or programmers are more familiar with the problems and their correct solutions.
The problem identification is the concept of getting good decision about the solutions of the
problems. The problem must be stated clearly, understood, and agreed upon by the user and
the analyst (programmer). It must state the objectives, the user is trying to achieve the results
and user wants to see. Emphasis should be on the logical requirements.
The first responsibility of a system analyst is to prepare a written statement of the objectives
of the problem. Based on interviews with the user, the analyst writes a brief description of
his/her understanding of the problem and reviews it with both the groups. People respond
to written statements. They ask for clarifications and they correct obvious errors or
misunderstandings. That is why a clear statement of objectives is important. In other words,
proper understanding of the problem is essential to discover the cause of the problem and to
plan a directed investigation by asking questions like what is being done. Why? Is there an
underlying reason different from the one the user identifies? Following are some possible
definitions of problems:
• The existing system has a poor response time
• It is unable to handle the workload.
• The problem of cost, that is the economic system is not feasible.
• The problem of accuracy and reliability
• The required information is not produced by the existing system
• The problem of security.
Preliminary investigation is study of the system. This is a brief investigation of the system un-
der consideration and gives a clear picture of what actually the physical system is? In practice,
the initial system study involves the preparation of a System proposal which lists the Prob-
lem Definition, Objectives of the Study, Terms of reference for Study, Constraints, Expected
benefits of the new system, etc. in the light of the user requirements. The system proposal is
prepared by the System Analyst (who studies the system) and places it before the user man-
agement. The management may accept the proposal and the cycle proceeds to the next stage.
The management may also reject the proposal or request some modifications in the proposal.
In summary, we would say that system study phase passes through the following steps:
• Problem identification and project initiation
• Background analysis
• Inference or findings

040
4 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Feasibility Study
It is the primary study about the system or program for evaluation. For example, a programmer
is going to write a program about linear equation of poultry industry, for this programmer
should study about number of poultry farms in that locality, social position about that industry,
market consumption environment, investment planning etc. The total study report about that
industry at the primary stage is called feasibility study. Therefore, sometimes feasibility study
is also called second phase of preliminary study.
After a problem has been defined in the problem phase, the selection committee requests the
information system department to conduct a feasibility study. The feasibility study determines
the best method to achieve the objectives of new information system that would solve the
problem. Feasibility study is the one of the important study about the program (system) which
expresses the real image of the project or system. There are following types of feasibility
studies.
1. Economic Feasibility
It is the feasibility study to find out the monetary and non-monetary benefits of the project.
It measures the cost-effectiveness of a project or solution. This is often called a cost-benefit
analysis. It puts the question. Is it possible to build a new information system with the available
resources? Similarly, the programmer (analyst) raises various financial questions during the
preliminary investigation of economic feasibility phase.
By conducting this study, the analyst can ascertain the following:
• Whether the project is economically feasible.
• If enough funds are not available, then what are the alternative sources of fund
generation?
• Whether there are sufficient benefits when compared to the costs incurred?

2. Operational Feasibility
The operational feasibility measures the operating requirements of the organization, like
support from the management, users, builders etc. It is also a measure of how people feel
about the program or project.
There are the two aspects of operational feasibility to be considered
1. Is the problem worth solving, or will the solution to the problem work?
2. How do the end-users and management feel about the problem (Solution)?
The above two points cover the performance, information, economy, control, efficiency and
service of the system. The following questions also arise in this feasibility report.
• Does management support the system?
• How do the end-users feel about their role in the new system?
• What end-users or managers may resist or not use the system?
• What is the working environment?
So, it is advisable that the system analyst must consider all the operational aspect carefully.
Programming Logics & Techniques 41
41
2 | Program/Software Development (Specification)

3. Technical Feasibility
It is a measure of the practicality of a specific technical solution and the availability of technical
resources and expertise. For example, existing computer system (hardware/software). There
are a number of technical issues that are generally raised during the feasibility stage of the
investigation.
• Is the proposed technology or solution practical?
• Do we currently possess the necessary technology?
• Do we possess the necessary technical expertise, and is the schedule reasonable?
• Does the data security, accuracy, reliability occur?

4. Time (Schedule) Feasibility


Time feasibility is a determination of whether a proposed project can be implemented fully
within a required time frame. If a project takes too much time, then it is likely to be rejected.

5. Social Feasibility
The social feasibility is a determination of whether a proposed project would be acceptable to
the people of the society or not.

6. Management Feasibility
It is a determination of whether a proposed project would be acceptable to management or
not. If management does not accept a project or gives a negligible support to it, then system
analyst would tend to view the project as non-feasible.

7. Legal Feasibility
It is a determination of whether a proposed project would be acceptable to the act, status as
well as any other pending legislation.

8. Political
Political influence is one of the important factors to any types of the system development
and more over any fields. The system should be analysed in term of political situation and
condition which is favorable or not.

Project (system) Approval


The outcome of the feasibility is the recommendation of a new system proposal. This new
information system proposal is to be sanctioned by the higher decision support group. The
sanctioned project is only started to implement system analysis

242
4 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Summary
Feasibility Study
In case the system proposal is acceptable to the management, the next phase is to examine
the feasibility of the system. The feasibility study is basically the test of the proposed system
in the light of its workability, meeting user’s requirements, effective use of resources and
of course, the cost effectiveness. These are categorized as technical, operational, economic,
schedule and social feasibility. The main goal of feasibility study is not to solve the problem
but to achieve the scope. In the process of feasibility study, the cost and benefits are
estimated with greater accuracy to find the Return on Investment (ROI). This also defines
the resources needed to complete the detailed investigation. The result is a feasibility report
submitted to the management. This may be fully accepted or accepted with modifications
or rejected. In short, the following decisions are taken in different feasibility study:
Economic feasibility - The likely benefits outweigh the cost of solving the problem which
is generally demonstrated by a cost/benefit analysis.
Operational feasibility - Whether the problem can be solved in the user’s environment
with existing and proposed system workings?
Organizational feasibility - Whether the proposed system is consistent with the
organization’s strategic objectives?
Technical feasibility - Whether the problem be solved using existing technology and
resources available?
Social feasibility - Whether the problem be solved without causing any social issues?
Whether the system will be acceptable to the society?

System Analysis (Requirement Analysis)


This is the total analysis of a system (program and hardware composition of a machine).
Sometimes opening a file and buffer do not match with the program, then program will not run
efficiently. That is called lack of system analysis. It is divided into two stages.
• System Study
• Requirement analysis
• System Study (Data Collection)
This is the study of the present information system in detail. Especially system study covers
the collection and validation of information. In system study, data can be collected by the
following methods.
- By Conducting Interviews
The programmer or system analyst takes interviews of the necessary people to collect
the data. The interviews are taken from the members of the system. This is very
important to collect different types of views, ideas and the solutions of the existing
problems. This is a time-consuming method.

Programming Logics & Techniques 43


43
2 | Program/Software Development (Specification)

- By Questionnaires
In this method of data collection, the system analyst or programmer distributes the
questionnaires and gets the response from the respondents. In this case the collection
of the data is very difficult because the collecting of the small data from the large
group of people is associated. The main advantage of this method is that a large
number of people can participate, so it is less time consuming and almost pure data
are collected. The field data collection is also one way to capture the data.
- On-site Observation
In this method, the programmer collects the data by absorbing the actual jobs, which
take place in the organization. Out of all fact-finding methods, this method is more
reliable. It is also time consuming but real data can be collected.
- Record Inspection
In this method, the system analyst goes through the documents of the organization
to collect requirements. The organizational documents usually include policies, rules
and guidelines. The document also gives details of the executives and directors to
whom the decision-making power lies.
- Data Analysis
The data analysis is a section of the system analysis. The technique used to improve a data
model in preparation for database design is called data analysis. In another sense, it is a
process that prepares a data model for implementation as a simple, no redundant, flexible,
and adaptable database. The specific technique is called normalization. After capturing the
necessary data to the project, the data validation should be done. The process of checking
the data at the time of data inputting and outputting is called data validation.
• Requirement Analysis (Programming Requirement and Analysis)
The term requirement analysis expresses two concepts. One is, what are the necessary
requirements to build the system (Program)? The hardware and software requirement also come
under the requirement analysis. The input, output and process requirement of the program.
For example, to develop a mark-sheet program, a programmer needs to input items (data and
format), process system and result format etc. They are the program requirement analysis.
Another concept is, what is the objective of the system builder, to user and the system owner?
It means, why do they build the system? All these points have to be understood by the system
analyst (programmer). The more emphasis should be given to the user's requirement within
the framework of the organization's objectives and the environment in which the system is
being installed. The consideration is given to the user's resources as well as to finances. To get
better performance and popularity of the program, the programmer should think of various
points. These points are helpful to design effective program. Some of the important points of
requirement analysis to develop efficient program are:
1. Program designing style and presentation.
2. Program reliability

444
4 Programming Logics & Techniques
2 | Program/Software Development (Specification)

3. Program efficiency
4. Program maintainability
5. Readability
6. Program development time period
7. Program development cost
8. Program documentation.

1. Program Designing Style and Presentation


To develop a particular program, the layout or structure of the program can directly contribute
to the overall quality of the programs.
Some of the important points about this topic are :
- The use of long meaningful identifiers for the program. They are constants, variables,
and sub-programs.
- The structure of programming code must be highlighted.
- The use of more appropriate program structure.
- The subprogram should give effective result and should occupy minimum of memory
spaces.
- Presenting of comments within a program that explain what is being done and how it
is done.
2. Program Reliability
Testing of program after completion of program is another important point to fulfill the
program designing analysis system. After the development of the program it should be tested
for the time being before selling into the market. After testing it should be certified under
certain terms and conditions. When the tested program comes into real use, then reliability of
the program will increase.
3. Program Efficiency
The program efficiency may express in terms of its use of resources such as time and storage
space. That is nothing; output of the program will be highly efficient and less complex.
4. Program Maintainability
The program will be easy to change or modify when the need arises.
5. Readability
The program will be easy for a programmer to read and understand. The program should be
written in simplest format and general English structure, then the readability of the program
will be increased.
6. Program Development Time period
This is a limited time (prescribed time) to develop a particular program as well as to get output
of the program. Any program should be finished within the limited period (prescribed time
period) and setting of time is also appropriate according to the requirement of the programmer
otherwise program may not develop in efficient way.

Programming Logics & Techniques 45


45
2 | Program/Software Development (Specification)

7. Program Development Cost


The program must usually be developed within specific budget; therefore, costing of program
development is also similar to the program development time. It means before writing a
program we should be sincere and have better economic plan about that program, the cost of
the program should be reduced to get better market in the world.
8. Program documentation
This is another important point to develop a particular program. After completing a program,
it should be documented either in softcopy or hardcopy format to get better popularity of the
program. From the user side, he/she wants to get better knowledge to handle the program. It
should be fulfilled by this document. This is called program documentation.
This documentation will include a statement of the problem (system specification), pseudocode,
flowcharts (if used), tables, test data and result technical details, details and instruction for
the user etc. Producing these documents should be done as part of each stage in programming
and not as an afterthought. If this is done, the documentation will aid the programmer in
programming and good documentation will aid the maintenance of a program during its
lifetime. Some programs have very long lives. For example, some programs written during
1960, are still in use today, although they may have been subjected to regular maintenance i.e.
modification or bringing up to date.
Hence, the programmer should have above aims to develop a good program. This is known
as programming aims. The requirement analysis system, the programmer and the user should
understand about points to get the efficient result of the program or system.

System Design
In the system design process, the primary objective is to identify user requirements and to build
a system that satisfies these requirements in the form of blueprint or softcopy format. The design
of system is mostly the logical design. These specifications, called the logical system design,
include the details of output, input files, database interaction, controls, procedures and reports.
The system design is the design of the system (program) and how this system would work.
Therefore, the most challenging and creative part of the system development life cycle is the
design of the system. Simply, it can be defined as giving proper shape and size to the program.
To get efficient output of the program the following things should well be designed.
- Output design
- Input design
- File design
- Procedure design
- Output Design
Giving the outer framework of the program or the system is known as output design.
The computer output is the most important and direct source of information for the user.
Efficient and user-defined output design should improve the system's relationships with

646
4 Programming Logics & Techniques
2 | Program/Software Development (Specification)

the user and help in decision-making. A major form of output is a hard copy output which
is printed from the printer. The output design is available either on the paper or on the
surface of the computer screen. The following media are used for output design.
ƒ Monitor (CRT 'Cathode Ray Tube' screen displays, LCD, LED)
ƒ MICR (Magnetic Ink Character Reader)
ƒ OMR (Optical Mark Reader)
ƒ OCR (Optical Character Reader)
ƒ Line, Matrix Laser printers
ƒ Computer Output Microfilms
ƒ Graph Plotters
ƒ Audio media

Output Design Consideration


The programmer should think about the required output of the program. Before designing
a system, this element plays vital role to develop an efficient system, so that programmer
will be clear about the project objective and progresses. To get the better knowledge about
the system output, the analyst will need to consider into the following terms :
1. Form Types
This is the type of the program or project. In another sense, we can say it is project
width (project belongs to different kinds of fields) some of the examples of types of the
project are trade and business, industry, education, research, and technology.
2. Volumes of Project
It covers the shape and size of the project or system. The shape and size directly influence
to the output of a system design. Some examples of volumes are shape and size occupied
by program, total area coverd by program (billing, ticketing, stock management, index,
invoice etc.).
3. Frequency of Report and Document
This is an efficiency of a program. The program can be used frequently and with high
reliability. Then we can say this program has more frequency.
4. Types of User and Purpose
Users may have different requirements and views. Some want summary report, some
want exception report and some want detailed report of the system. Therefore, the
output design is based on the user type and their purpose.
5. Contents
The contents heading should also be specified because they give the clear vision to the
user. These would be related to the purpose of the output.
6. Format
The outer format of the report is very important to analyse information. It specially
refers to the arrangement of data, headline, title, size of the paper, colour etc.

Programming Logics & Techniques 47


47
2 | Program/Software Development (Specification)

7. Volume
What is the required volume of the output is another important point in the system
design. This also has an effect on the designing system. On the basis of this, the cost,
time etc. estimation is affected.
8. Quality
Quality control is one of the important phases in the system development. For this, each
and every topic are related. Therefore, in system design quality control and maintenance
affect the overall design of the system.

- Input Design
Once the output requirements have been finalized, the next step is to find out what data
needs to be made available to the system to produce the desired output. In this design
the source of the input data collection, document preparation and verification play the
important role. Specially, the system analyst or programmer decides the following points
for the input design of the system.
1) What are the data types and availability?
2) What media to use?
3) What arrangement of the data has been provided?
4) The dialogue to guide users for providing inputs.
5) Data items and transactions needing validation to detect errors.
6) Input Validation style and steps for error validation.
The input design covers all the phases of input from data collection (gathering), validation
to actual entry of the data to the system for processing. Whatever the input design media
is used to design the input design but the CRT and LCD -input screen design is mostly
used in modern designing system which has following advantages.
ƒ Easy to use
ƒ Improved processing speed
ƒ Menu driven screen
ƒ Emphasizing upon information on display screens
ƒ Colour selection and designing is very simple and easier.
ƒ Editing through display screen is very friendly.

- File Design
After gathering the data, the input design has to be done to the system. The verified data
are to be stored into the logical storing devices for their further processing. The data are
measured in certain unit known as bit and byte. The preparation of database system is
known as file design. File is the name of collection of information about the particular
things in systematic manner. Hence, a database is a collection of related information that
is available to many users. A database can handle business application such as inventory,
accounting and preparing notes. The well-known example of database is MEDILINE

848
4 Programming Logics & Techniques
2 | Program/Software Development (Specification)

which is database service providing medical information for doctors. To design the file
the following decisions play an important role.

Type of Data Items:


ƒ Length of the records, fields etc.
ƒ The order of arrangement of the records.
There are different types of methods to organize the file. The following methods are
mostly used
1. Alphabetical Order:
- Sizing order – order of memory size
- Dating order – order of date.
- Typing order – Alphabetical order of extension
2. File Security
Protection of the file to give longer life of the system as well as protection from copyrighting
system, file security terms play vital role. Generally, file security gives the protection to
the file by doing different methods
- Supplying password
- Protecting by system, archive, hidden etc.
- Proper handling of the system
3. Records Layout
This is the shape and size of the record, which can be assigned under certain width by
number. In the program, increasing of record length decreases the efficiency of program.
Therefore, unnecessary size of record should not be given to design the better system.
This is called record layout.

- Procedure Design
The procedure design is specially concentrated to the steps of the designing of the input,
the output and the file design. Hence, it is also known as input/output design. In this
design, the system analysts or programmers are interested to find the processing system
to achieve the efficient output. What kind of procedures are carried out by the computer
during the processing activities is the main objective of the procedure design of the
program.
Control Design
It is the design of the control of the system which includes procedures that would ensure
correctness of processing, accuracy of data, timely output etc.
Good program will only come from good program design.
The program design covers the following terminology: Algorithm, Flow chart, Decision table,
pseudocode etc. This will be discussed on later.

Programming Logics & Techniques 49


49
2 | Program/Software Development (Specification)

System Development and its Construction (Program Coding)


The system building concept comes under this topic. The designed system starts to build the
real image of the project which is known as system development. If the programmer is starting
to develop a computer program using relevant software, it is also called program coding. In
this case the programmer may consult the system designer or system analyst if he/she needs.
The programmer has to concentrate his/her brain to get efficient program by using the least
possible number of program syntax and statements. In simple sense, the system development
is the construction of the system. The design specifications are converted into the source code
in the programming language. The programmers are responsible for carrying out activity.
The software, which is to be developed, is divided into many modules. The modules have
independence. The individual models are the section of the main program. The simplest and
easiest ways of program development approach is modular approach.
System Conversion
The system conversion is the process of converting from old system to new system. The
process of replacing an existing system with a new system is also called system conversion.
The old program is replaced by the new or upgraded program which is called program
conversion. The system conversion can be done by the following four ways.
1. Parallel System
In this conversion method, both the systems run parallels until the full satisfaction of the new
system appears. After getting the full confidence, the user may remove the old system or may
keep as an ideal system.
2. Direct Conversion
In this conversion system, the old system is directly replaced by the new system. This approach
of system conversion is known as Cut Approach.
3. Pilot System
This is the part conversion system where the part of the old system is replaced with the new
system. After some time, the entire old system is replaced with the new system. The system
conversion is done based on the user feedback and the requirement of the system.
4. Phase-in Method
This is the conversion of the system phase wise. Due to the certain circumference, the old
system cannot be replaced at a time, then this approach is applied.

System Testing and Debugging


The system testing is the process of improving the system by debugging the problems from
the system. The purpose of the system (program) testing is to identify and correcting errors
in the system. Testing is the process of making sure that the program performs the intended
task or we can say the purpose of testing is only to identify the errors in the system. There are
different types of testing approaches:

050
5 Programming Logics & Techniques
2 | Program/Software Development (Specification)

1. Applying Judgment
In this case, different teams are formulated and programs are tested. Such teams test the
program and find out the errors occurring in the program or make sure that the program
performs the intended task.
2. Applying Skill
We can also test the program by using our general ideas or logic to determine whether the
results of the program are as we want.
3. Applying Knowledge
The program can be tested by our knowledge or understanding of the program.
Performance Criteria for System Testing
The following performance criteria are used for system testing.
a) Turnaround Time
This is the elapsed time between the receipt of the I/P and the availability of O/P. The
objective is to decide on and evaluate all the factors that might have a bearing on the
turnaround time for handling all the applications.
b) Back Up
This term relates to the procedures to be used when the system is down. Backup plans
might call for the usage of another computer.
c) File Protection
This option refers to sorting of files in a repartee area for protection against fire, flood or
natural disaster. Plans should also be established for reconstructing files damaged through
a hardware malfunction.

System Testing
Usually, the system or program is tested partly called unit testing. The part of the individual
program is called modules. So, module testing (unit testing) is one of the important methods
of the program testing. System Testing is a level of the software testing where a complete and
integrated software is tested. The purpose of this test is to evaluate the system’s compliance
with the specified requirements.
Acceptance Testing

System Testing

Integration Testing

Unit Testing

Programming Logics & Techniques 51


51
2 | Program/Software Development (Specification)

In another way system testing can be defined as the process of testing an integrated system to
verify that it meets specified requirements.

Different Types of System Testing


There are more than 50 types of System Testing. For an exhaustive list of software testing
types click here. Below we have listed types of system testing a large software development
company would typically use:
1. Usability Testing - Usability Testing mainly focuses on the user's ease to use the
application, flexibility in handling controls and ability of the system to meet its objectives
2. Load Testing - Load Testing is necessary to know that a software solution will perform
under real-life loads.
3. Regression Testing - Regression Testing involves testing done to make sure that none of
the changes made over the course of the development process have caused new bugs. It
also makes sure that no old bugs appear from the addition of new software modules over
time.
4. Recovery Testing - Recovery testing is done to demonstrate that a software solution is
reliable, trustworthy and can successfully recoup from possible crashes.
5. Migration Testing - Migration testing is done to ensure that the software can be moved
from older system infrastructures to current system infrastructures without any issues.
6. Functional Testing - Also known as functional completeness testing, functional
testing involves trying to think of any possible missing functions. Testers might make a
list of additional functionalities that a product could have to improve it during functional
testing.
7. Hardware/Software Testing - IBM refers to Hardware/Software testing as "HW/SW
Testing". This is when the tester focuses his/her attention on the interactions between the
hardware and software during system testing.

What Types of System Testing Should Testers Use?


There are over 50 different types of system testing. The specific types used by a tester depend
on several variables. Those variables include:
• Who the tester works for - This is a major factor in determining the types of system
testing a tester will use. Methods used by large companies are different from those used
by medium and small companies.
• Time available for testing - Ultimately, all 50 testing types could be used. Time is often
what limits us to use only the types that are most relevant for the software project.
• Resources available to the tester - Of course some testers will not have necessary
resources to conduct a testing type. For example, if you are a tester working for a large
software development firm, you are likely to have expensive automated testing software
not available to others.
252
5 Programming Logics & Techniques
2 | Program/Software Development (Specification)

• Software Tester's Education - There is a certain learning curve for each type of software
testing available. To use some of the software involved, a tester has to learn how to use it.
• Testing Budget - Money becomes a factor not just for smaller companies and individual
software developers but large companies as well.

The program or system testing consists of the following steps :


1. Program Testing
The testing of the program logically and physically is known as program testing. The testing
of the program is to find out the two types of the errors. They are:
• Syntax Error: When rules of the language do not match, that is, some spelling and
grammatical mistake occur, it is called as syntax error.
• Logical Error: It is due to the entry of incorrect data, out of range and invalid
combinations of the inputs. In this case, debugging of the errors are very difficult.
The error detection is done with comparing actual output with the expected output.

2. String Test
In the string test, developer and functional analyst sit together and test the program by giving
different conditions. After Coding and Unit Testing, String Testing activities are conducted.
The intent of string testing is to begin the validation that the newly coded object meets the
needs defined in the functional and technical design.
This tests the one program, which is related to other programs. This may interact with the whole
system. Individual testing against the entire module is the errors debugging methodology.

3. User Acceptance Testing


It is the last test of the system before delivering it to the customers. This test identifies whether
program is working under the rules and regulations of system specification or not. It is useful
to detect following specification of the program: Tolerance, Performance range, Error rate and
Accuracy.

System (Program) Implementation


In general sense, the implementation means taking the action of the system to the real use but
it covers wide range of meaning. The system or program implementation process starts from
the conversion of a basic application and ends in complete computer system replacement.
Therefore, after the development of a program, system implementation is started but to
develop a good program implementation concept is introduced from the beginning of the
system development. Good program implementation creates the standard of the program and
its establishment. Market study and business policy will also increase the implementation of
program. The three types of implementation (conversion) are used.

Programming Logics & Techniques 53


53
2 | Program/Software Development (Specification)

a. Implementation of a computer system to replace a manual system


The manual system is replaced by a computer system to make work fast and efficient.
In this case, the following works are done files conversion, providing users training,
creating accurate files and verifying printout for integrity.
b. Implementation of new computer system to replace an existing system
This is the upgrading of a system or program. Therefore, system analyst should be
serious to replace the existing system. Otherwise the problems may occur in the system.
Depending upon size of the system, conversion time depends.
c. Implementation of a modified application to replace an existing system by using the
same computer
It is the easiest implementation method where serious problem may not come into the
system.
Before implementation the system operator training and user training should be provided
by the system analyst or by the programmer.

System Evaluation, Maintenance and Monitoring


System evaluation begins with the system maintenance. The implementation and delivery
phase of the system development is finished, then different types of suggestion and comments
may come to system analyst or programmer. On the basis of these types of reports, the higher
decision levels can categorize the system. This type of system analysis is called system
evaluation.
Proper maintenance and monitoring of program is another important aspect about the system
development concept. Therefore, frequent maintenance and monitoring also needed to gain
more popularity about a program development sectors. After implementation of program
the maintenance begins. It is an iterative process. It has been divided into following major
activities.
a) Fix: It is always not possible to locate all the errors during the testing stage. When the
system is put into usage some errors may arise. These errors ought to be removed.
b) Enhance: The system is to be expanded to take care of new requirements.
c) Adopt: The system is to be exposed to different environment.

System Evaluation
The system should be evaluated to find its usefulness. The system is evaluated based on the
following approaches:
a) Operation Evaluation: How is the system useful in terms of response time, ease of
use, reliability and suitability in information format?
b) Organization Impact: How is the system useful in terms of monetary section? It
directly impacts the system of organization.

454
5 Programming Logics & Techniques
2 | Program/Software Development (Specification)

System Security
The security is the system to give protection to the program or system. Providing the good
security to the system is one of the important stages of the program development life cycle.

Programming Errors
After the completion of system designing work, the programmer should have knowledge or
ideas to find out even minor problems or errors occur in the system or program. The logical
error identification and correction is really sophisticated work. The following factors cause
the errors into the system:
a) Design Error
b) Poor Quality Control
c) Other Utilization and Overloading
d) Wear out

a) Design Error
This error occurs at the time of system designing due to the lack of knowledge and sensitivity
of a programmer. The entire necessary environment may be accounted at the time of design
process and errors may occur. These kinds of error are known as design error. To correct these
errors, system designer or programmer should think about the system from the beginning
point of system designing work. To identify the problems, the analyst should prepare the
verification teams to verify the errors. The different teams validate the errors and finally a
conclusion is considered as final errors of the system design.
b) Poor Quality Control
This error may occur at the time of program coding. They are not detected at the time of
coding. Another reason to occur this error is incompatibility of various modules and conflict
of conversions between different versions of the operating system.
c) Over Utilization and Overloading
This error occurs due to over-handling the system as well as over supplying the data to it.
Any system is designed for certain time period and within certain circumference, therefore it
should be operated at that environment. Once it has crossed that limit, then various kinds of
errors may be detected in the system. They are called over utilization and overloading errors.
These errors can be controlled by two ways.
1. Supplying of data and handling of program within prescribed environment.
2. Running the buffer and stacks within their boundaries. The example of this error
is unbalanced defining of files and buffers in the autoexec.bat file (program
running files)
Autoexec.bat
Files = 30
Buffers = 30
Programming Logics & Techniques 55
55
2 | Program/Software Development (Specification)

d) Wear Out
This error is known as out-dating error. The wear out error of the software mostly does not
occur in the system because this error can only be detected after the use of all facilities of the
program. To verify and modify this type of error, invention of new technology is required;
for example, by releasing new versions of the software. e.g. the problems of windows 3.1 are
modified by new version of windows i.e. windows 95. Problem of windows 95 is overcome
by releasing windows 98 and so on.

Bugs
Computer programs are programmed by human beings, so these programs will be subject to
errors. These program errors or faults are known as bugs and the process of finding out errors
or fault by doing various kinds of activities to the program or system is known as debugging.
The debugging task is done by patching up job. This is the process of locating and eliminating
program errors. This is the process of finding alternative or forming alternative section of
testing of program to find out the bugs. The alternative process of testing to remove the bugs
are called patches or fixes.
In the program, there are mainly three types of errors
a. Syntax error
b. Logical error and
c. System error.
1. Syntax error
These are the grammatical errors, spelling mistakes in the program. These errors result when
the rules or syntax of the programming language are not followed. These kinds of errors occur
at the time of program development and are easily debugged at the time of compilation. By
absorbing the nature of errors a programmer should identify and debug these errors. Some of
the important kinds of syntax errors are listed below:
• Variable not found.
• Statement missing (missing of;) etc.
• L value requited.
• Data mismatch (over flow)
• Invalid data conversion.
• Divide by zero
• Run time error.
For example, the C statement for (j=1; j<10; j++ has a syntax error. In this example, the
problem is missing closing parenthesis, which should be placed in the appropriate place
depending on the logic of the program. Almost all language processors are designed to detect
syntax errors. This processor prints error messages on the source listing that indicate the
line number of statement with errors and give hints as to the nature of the error. Thus, it is a
relatively easy task to detect and correct syntax errors.
656
5 Programming Logics & Techniques
2 | Program/Software Development (Specification)

In high-level languages, a single error often causes multiple error messages to be generated.
There are two reasons for this: one is that these language instructions often require multiple
machine steps. The other reason is that symbolic instructions are often dependent upon other
instructions. For example, an instruction containing an error is one that defines a field name;
all instructions in the program using that field name will be listed as errors.

2. Logical Errors
This is the error in the logical sequence of the program. Logical errors are complex types
of errors in the program; therefore, to find out them is very complex task. Therefore, a
programmer should think about the program and its required output whether we are getting or
not. At the time of compilation computer doesn't show any error and we will get the output.
The computer actually doesn't know that an error has been made. It follows the program
instructions and displays the results, but the output is not correct. The problem is that the logic
being followed doesn't produce the results that were desired. When a logical error occurs, all
we know that the computer is not printing the correct O/P. The computer also doesn't tell the
error message, so it is very difficult to debug the errors.
For example for (j=1; <=10;j++)
This is the logic loop to display number 1 from to 10, but our requirement is up to 15 then
this is called logical error. In this condition computer does not display any error message.
Therefore, it is difficult to identify the errors.

3. System Errors
These errors occur due to the hardware failure and software failure. Therefore, system
modification or replacement is only the reason to debug errors of this nature.
Some examples are
1. Stack overflows (memory mismatching with respect to given data types).
2. Buffer mismatch (Mismatching of programming, file-opening system with respect to
computer hardware etc.) some examples are config.sys, autoexec.bat, sys.ini, win.ini
etc.
3. Insufficient memory- This is the error due to the memory mismatching (hardware
defect, Ram, Mismatching of buffer and file)

Conclusion
After correcting all the syntax errors, we must check for logical errors. For this we must have
some sample data and calculated result. Using these data, we must first execute the program
by giving the run command. The result given by the computer must be checked with the
calculated result. If the both results are the same, then the program is free from logical errors,
otherwise we must find out the errors and correct it from the beginning point.

Programming Logics & Techniques 57


57
2 | Program/Software Development (Specification)

Summary
Stages of System Development Life Cycle (SDLC)
The System Development is the interactive process which consists of the following stages
Preliminary Investigation: One of the most tedious task is to recognize the real problem
of the pre-installed system. The analysis has to spend hours and days for understanding
the fault in the system. This fault behavior could have overcome if the Preliminary
Investigation before installing the system was properly done. This is the first stage of the
development of the system. In this stage, the analyst makes a survey by gathering all the
available information needed for the system elements and allocation of the requirements
to the software.
Analysis of the requirement: The analyst understands the nature of the information and
the functions of the software which is required for the system. The analyst makes a brief
survey of the requirements and tries to analyze the performance of the system which is to be
developed. He also makes sure that he gets enough information and resources for building
the appropriate system.
System Design: The analyst actually makes number of designs of the system on paper or
in the computer and sees whether the rough image made of the system comprises all the
requirements or not. Once this is done, the analyst selects and finalizes a best suited design
for the development of the system.
System Coding: The analyst translates the code or the programs in such a way that they
become in machine readable form. The coding step is very time consuming and involves these:-

1. Preliminary
investigation

6. Systems 2. Systems
maintenance analysis

5. Systems
3. Systems
implementation
design

4. Systems
development

858
5 Programming Logics & Techniques
2 | Program/Software Development (Specification)

System Testing: Once the analyst is through with the coding stage he tests the systems
and sees whether it is working as per the expectations or not. He corrects the flaws in the
system if any.
System Implementation: This is one of the most vital phase. In this phase the analyst
actually gives the system to the customer and expects for a positive feedback.
System Maintenance: The last stage of the SDLC is that the analyst needs to maintain the
system and see that it is working within the standards set. He needs to maintain the system
by removing the defects of flaws occurred.

Difference between Testing and Debugging


Testing and debugging are two separate tasks. The differences between these two processes
are outlined below:
Testing Debugging
1. Testing takes more time 1. Debugging takes less time
2. It is a process in which program is 2. Debugging is a process in which
validated program errors are removed.
3. It's positive activity that seeks to 3. It is negative activity in that it is centered
demonstrate that the program is correct on elimination of known errors or bugs.
and does in fact meets its design
specifications
4. It is completed when all desired 4. When there are no known errors, only
verifications against specifications have then this process closes.
been performed
5. It has a systematic planning and time 5. It does have a planning and time
period. schedule whenever problem occurs, it
must be debugged.
6. The testing begins from the first phase 6. Debugging, on the other hand can't
of the system development life cycle. In begin until the end of the development
each and every stage testing is necessary. cycle, because it requires an executable
program.

Programming Tools (Algorithm and Flow Chart)


Algorithm
It is well known that the programs are used to solve the various kinds of problems by
computerized technique. Directly writing the computer formatted codes called program is very
difficult. So instead of this some simple mechanism is necessary. Some most popular tools are
used to make the program development process simple. Out of these tools, algorithm is one of
Programming Logics & Techniques 59
59
2 | Program/Software Development (Specification)

them. Hence, the prewritten English language in step wise order to perform specialized task
is called algorithm. We can say that the step wise instructions about the particular system to
get specific output. Therefore, algorithm is the initiating stage to develop an efficient system
or program.
To write an algorithm the given sequence of instructions must possess the following
characteristics:
1. Each and every instruction should be accurate and clear.
2. Each instruction should finish within definite time interval.
3. One or more instructions should not be repeated infinitely. It is obvious that the
process should once be terminated.
4. After termination of the algorithm, the definite output must appear.

Questions
1. Write an algorithm to find out total and average mark of 10 students consisting of seven
subjects and print the result.
Step 1. Start to write a program of mark sheet.
Step 2. Assume subject = 1, total =0, No of student = 1
Step 3. Input the mark of the seven subjects
Step 4. Are all 7 subjects done?
If no then increase the subject number and go to the step no: 3 otherwise go to step
no. 5
Step 5. Add and print sum or total.
Step 6. Calculate average of seven-subject mark.
Step 7. Are all 10 students mark entered?
If no, increase the student number and go to step no. 3 if yes then go to step no 8.
Step 8. End.
2. Write an algorithm to prepare sheet or sequence of an instruction to develop following
program. (Assignment: Assume suitable inputs).
a. General bill report.
b. Start to write a program of bill report.
c. Electric bill report
d. Telephone bill report
e. General salary sheet report

Flowchart
The pictorial representation of sequence of events that describes the activities required in the
program to solve the particular problem is called flowchart. Therefore, a flowchart is a pictorial
representation of an algorithm. The chart provides better concept about the programming so
that programmer can write correct program. The sequence of events is represented by the
different symbols and connected by the flow lines.

060
6 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Boxes of different shapes are used to denote different types of instructions. The actual
instructions are written within these boxes using clear and concise statements. Solid lines
having arrow marks to indicate flow of operation connect these boxes. The flow chart creates
the logical ideas to the programmer. Once the flowchart is ready, the programmer can forget
about the logic and can concentrate only on coding of the programming language. Hence, we
can say that the flowchart is the picture of the logic to develop the program.

Features of Flowchart
To draw the flowchart the following features are to be taken into consideration:

• Originating or Origination
The collection of source data is an important job in any system either to draw flowchart or to
develop a program. Thinking about the system logically as well as collecting of resources to
develop the program, this feature is known as originating feature.

• Inputting
The processing of supplying data or instructions to a computer is called inputting of records
to the computer. This process of supplying data to the computer by different media is known
as input or inputting.

• Processing
To obtain specific output with respect to given data or instruction, certain process should be
happened into the computer. This is known as processing.

• Storage/ Storing
After manipulating of system or program the data or instruction and output results either store
temporarily (RAM/ROM) or permanently (Floppy disk, hard disk, CD-ROM, Zip drive pen
drive, DVD etc.) into the computer. This is called storing of information.

• Outputting
The output result appears after the completion or processing work is called outputting.

Advantage of the Flowchart


Some of the important benefits may be obtained when flowcharts are using for specific purpose
of program planning.
• Better communication.
• Effective analysis
• Effective synthesis
• Proper program documentation
• Efficient coding
• Systematic debugging
• Systematic testing
Programming Logics & Techniques 61
61
2 | Program/Software Development (Specification)

Better Communication
A saying is that "a picture is worth a thousand words" which is true in the case of flowchart.
The communication means understanding of information in between two things. Similarly,
in the case of flow chart, meaning of communication is happened to all kinds of computer
languages. But all kinds of languages are not inter-related to communication technique and
logical ideas to solve specific problems. The flowchart is same for all languages. Therefore it
is easier for programmer to explain the logic of a program.
Effective Analysis
Drawing a macro flowchart is a very complex task, therefore a micro flowchart that has
number of lines of logic in software is used. It is very difficult to analyse at a time, which can
be broken out in separate section for study and further analyzing of a program.
Effective Synthesis
A group of experts or programmers are normally associated with the design of a complex
system or program. A micro flowchart is the part of the macro flowchart hence drawing the
individual micro flowchart makes the system simple and efficient. Thus, flowcharts are one of
the important models to design a complete system. To make a complete flowchart, individual
flowcharts combine together and form a complete flowchart of the system.
Proper Program Documentation
Documentation of the program starts from initialization and close at the end of the program.
Program documentation is the overall written procedure of the program development and
maintenance. In another way, controlling of program by doing different types of actions is
called program documentation. In program documentation, there are following stages.
a. Collecting of data
b. Initializing and organizing of data
c. Storing
d. Outputting
e. Trouble Shooting
Efficient Coding
After plotting a flowchart, a programmer is going to code a program. It gives total infrastructure
about the system. Hence, a flowchart is electronic road map to the programmer.
Systematic Debugging
A designer always takes care about the program, and thinks about how to develop an error free
efficient program; even though some errors or bugs may have been detected in the system. These
types of errors can very easily be analyzed and removed even at the flowchart-designing period.
Systematic Testing
Testing of a program or system after completion of work is one of the important steps to get
better result of that program. Therefore, systematic testing of program occurs even from the
drawing of flowchart. In that period, we may get different types of problems, which can be
eliminated by testing the flowchart in systematic manner.

262
6 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Disadvantages of Flowchart
Some of the important disadvantages of flowchart are as follows:
Time Consuming and Laborious Work
Flowcharts are time consuming and laborious to draw with proper symbols and spacing,
especially for a large and complex program. Once programmer has better knowledge about
the system, it may not be necessary to plot a flowchart. Therefore, it is a complex as well as
time-consuming work.
Expensive and Difficult for Modification
Drawing a flowchart as well as modification is difficult task rather than program modification.
Creating of a new flowchart means applying of skilled manpower and investment which
creates more economic burden.
Standard Limit of Investment
Drawing a flowchart is not concentrated within certain circumference. Different programmer
can use different logical ideas to draw the same flowchart. Therefore, it doesn't contain any
limitations of investment.

Summary
A flowchart is a common type of chart, that represents an algorithm or process,
showing the steps as boxes of various kinds, and their order by connecting these with
arrows. Flowcharts are used in analyzing, designing, documenting or managing a
process or program in various fields.

History
The first structured method for documenting process flow, the "flow process chart", was
introduced by Frank Gilbreth to members of ASME in 1921 as the presentation “Process
Charts—First Steps in Finding the One Best Way”. Gilbreth's tools quickly found their
way into industrial engineering curricula. In the early 1930s, an industrial engineer, Allan
H. Mogensen began training business people in the use of some of the tools of industrial
engineering at his Work Simplification Conferences in Lake Placid, New York.
A 1944 graduate of Mogensen's class, Art Spinanger, took the tools back to Procter and Gamble
where he developed their Deliberate Methods Change Program. Another 1944 graduate, Ben
S. Graham, Director of Formcraft Engineering at Standard Register Corporation, adapted the
flow process chart to information processing with his development of the multi-flow process
chart to display multiple documents and their relationships. In 1947, ASME adopted a symbol
set derived from Gilbreth's original work as the ASME Standard for Process Charts.
According to Herman Goldstine, he developed flowcharts with John von Neumann at Princeton
University in late 1946 and early 1947.
Flowcharts used to be a popular means for describing computer algorithms. They are still
used for this purpose; modern techniques such as UML activity diagrams can be considered
Programming Logics & Techniques 63
63
2 | Program/Software Development (Specification)

to be extensions of the flowchart. However, their popularity decreased when, in the 1970s,
interactive computer terminals and third-generation programming languages became the
common tools of the trade, since algorithms can be expressed much more concisely and
readably as source code in such a language. Often, pseudo-code is used, which uses the
common idioms of such languages without strictly adhering to the details of a particular one.

Flow Chart Building Blocks (Symbols)


Flow chart is the whole system which is formed by interconnection of various symbols. There
are some symbols which are mostly used to draw a flowchart. They are given below:
Representation/
Symbol Name of Symbol Function
Shape

Start and Stop/ Oval Starting and ending of a


Termination program.

Input and output Parallelogram Inputting data/records and


printing output result.

Processing Rectangle Calculating the result with


respect to the given data.

Decision Diamond Decision making work like if


condition.

Receiving the input information


Display document Rectangle with right and generating output report.
Notched (Some time it can be used
instead of output symbol)

Arrow Arrow Head Line Flow of information in the


flowchart diagram.

Connector Circle or Point Connect the separate elements


of the flowchart within a page.

Off Page connector Rectangle with Connect the multiple pages


Arrow elements of the flowchart. It
exits in complex flow chart.

464
6 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Other symbols used to draw flowchart


Symbol Name of Symbol Function

The stored data symbol Stores the data in storing device.

The summing junction


Sum up all the inputs in a particular point.
symbol

The predefined process Indicates a complicated process or operations


symbol that is well-known or defined elsewhere.

Represents data stored in random access


The internal storage symbol memory (RAM).

Represents the manual input of data into a


The manual input symbol computer, usually through a keyboard.

Indicates a step that must be done manually,


The manual operation
not automatically.
symbol

The merge symbol Combines multiple paths.

The multiple documents


Represents multiple documents or reports.
symbol

Differentiates between steps that prepare for


The preparation symbol
work and steps that actually do work.

Programming Logics & Techniques 65


65
2 | Program/Software Development (Specification)

Examples: Draw a flow chart to find out factorial of any given number N.

Start

Read N

M=1
F=1

F = F*M

NO IS
M=M+1 M=N?

YES
PRINT F

END

A simple flowchart for computing factorial N (N!)


Its a flowchart for computing factorial N (N!) Where N! = 1 * 2 * 3 *...* N. This flowchart
represents a "loop and a half" — a situation discussed in introductory programming textbooks
that requires either a duplication of a component (to be both inside and outside the loop) or
the component to be put inside a branch in the loop.

Types of Flow Charts


There are many different types of flowcharts. On the one hand, there are different types for
different users, such as analysts, designers, engineers, managers, or programmers. On the
other hand, those flowcharts can represent different types of objects. Stern Eckert (2003)
divides four more general types of flowcharts:
• Document flowcharts, showing a document flow through system
• Data flowcharts, showing data flows in a system
• System flowcharts showing controls at a physical or resource level
• Program flowchart, showing the controls in a program within a system
However, there are several of these classifications. For example, Andrew Veronis (1978)
named three basic types of flowcharts: the system flowchart, the general flowchart, and the
detailed flowchart. That same year Marilyn Bohl (1978) stated "in practice, two kinds of
flowcharts are used in solution planning: system flowcharts and program flowcharts...". More
recently Mark A. Fryman (2001) stated that there are more differences. Decision flowcharts,

666
6 Programming Logics & Techniques
2 | Program/Software Development (Specification)

logic flowcharts, systems flowcharts, product flowcharts, and process flowcharts are "just a
few of the different types of flowcharts that are used in business and government."

Program Flowchart
It is a flowchart, which is oriented to solve the problem through a program. This flowchart
is known as program flowchart. The size of flowchart depends on the nature of the problem.
General program flowchart sample is given below.

Questions
1. Draw a flowchart of a class and find out percentage of mark by assuming following 3
points:
a) Simple flowchart for single student.
b) Unlimited flowchart for no of student.
c) No of students with specific output
2. Draw a flowchart and dial a telephone no. to make command by using double decision
box in the program.
3. Draw a flowchart and develop a system or program to get specific output.

Decision Table
Decision Tree
A graphical representation of conditions and outcomes to the program that resembles (forms)
the branches of a tree are known as a decision tree. It represents the conditions and actions in
the form of a tree structure when dealing with program problems where there are a number
of possible alternative actions. It is helpful to work out all the possible alternatives before or
after writing flowcharts, algorithms or pseudocodes.
To prepare a decision tree there are different methods but branching method is very common.
The conditions are represented as nodes of the decision tree. The actions are represented as
leaf nodes of the tree. The root of the tree is starting point. Progressing from left to right along
a particular branch is the result of making a series of decisions. The general structure of the
tree has been shown in figure.
action
Condition condition condition condition
Root
Condition condition condition condition action

Decision Tree Structure


The main advantage of decision tree is easy to understand the program easily whereas the big
program creates complexity and unmanageable situation of decision table is the disadvantage.
An example of decision tree for preparing a tea-coffee is given below.

Programming Logics & Techniques 67


67
2 | Program/Software Development (Specification)

Sugar
Black
Tea No Sugar
White
Drink Sugar
Black
Coffee No Sugar
White
Sugar
Fig.: Decision tree
Decision Table
It is the table of possible alternative ideas to develop a system or program. Decision tables
are used to define clearly and concisely the conditions and actions in a tabular form. It creates
logical views that tell us what action to take when a given condition is true or otherwise. This
table shows decision making alternative.
The following steps are necessary to construct the decision table:
• Properly define the problems that have to be solved by computer.
• List out all the conditions to be tested in the problems.
• List out the corresponding actions that should be taken with each combination of
conditions.
• Form a decision table using actions and conditions.
Generally, the decision table has four quadrants. The upper left is a condition stub that contains
a list of possible conditions. The bottom left quadrant is an action stub that contains the list of
actions. The upper right quadrant is a condition entry where condition values are entered. The
condition entries may be in yes or no form. The lower right quadrant is an action entry stub
which contains the action entries. These are entered as X or √ (cross/Tick Mark). The general
structure of decision table is as shown below.
Condition Stub Condition entry Stub
Action Stub Action entry stub
Table: Structure of a decision table
Advantages
The advantages of the decision table are given below:
• They are easier to draw and replace the flowchart.
• They provide more compact documentation. A small table can replace several pages of
charts and paragraphs
• It is also easier to follow a particular path down one column than through several flow-
chart pages.

868
6 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Disadvantage
These are not very popular and not so widely used because
• Flowcharts are better to express the total sequence of events needed to solve a problem.
• Flowcharts are more popular in common, many programmers and beginners hence prefer
practice.

Example-1
Let us explain the decision table with the help of an example to prepare a cup of tea or coffee
with or without sugar sees the following table.

Solution
The alternative conditions are 8, Y =Yes, N =No
Conditions
Y=Tea, Black, sugar N=Coffee, white, without sugar
Tea Y Y Y Y N N N N
Black Y Y N N Y Y N N
Sugar Y N Y N Y N Y N
Actions
Pour milk into bottom of cup √ √
Fill up rest of cup with tea √ √
Fill up with tea √ √
Pour normal amount of √ √
coffee into cup
Top up cup with milk √ √
Fill up with coffee √ √
Add sugar √ √ √ √
Stir cup √ √ √ √ √ √

Example-2
Let us consider the following situation. It is required to compute the income tax. The rules for
computing commission are as follows:
Condition Action
If the total income ranges from 0-60,000 No tax.
If the total income 60,001-80,000 10% of total income
If the total income is above 80,001 2000+ (20% of total income)
Irrespective of whether one has to pay tax or not, the individual has to submit the tax details
before the end of accounting year. If the accounts are not submitted before Jun, Rs. 500 more
fine is added to total tax.
Programming Logics & Techniques 69
69
2 | Program/Software Development (Specification)

Solution:
The decision table is constructed with given conditions and possible alternative solutions are
shown on the table. This is given as follows:
Conditions
Tax details submission before Jun Y Y Y N N N
Income Range 0-60,000 Y N N Y N N
Income Range 60,000-80,000 N Y N N Y N
Income Range>80,000 N N Y N N Y
Actions
A1 X
A2 X
A3 X
A4 X
A5 X
A6 X
Actions.
A1-Compute tax = 0
A2-Compute Tax = 10% of total income
A3-Compute Tax = 2000+(20% of total income)
A4-Compute Tax = 0 + 500
A5-Compute Tax = (10% of total income) + 500
A6-Compute Tax = 2000+(20% of the total income) +500

Example-3
Study following conditions and draw decision table:
• If product code=A and customer type=1 and the order amount<=700 then 5% discount is
allowed.
• If product code=A and customer type=2 and the order amount<=700 then 7.5% discount
is allowed.
• If product code=A and customer type=1 and the order amount>700 then 7.5% discount
is allowed.
• If product code=A and customer type=2 and the order amount>700 then 10% discount is
allowed.
• A flat discount of 5% on product code=B regardless of customer type and the order
amount.

070
7 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Solution:
The decision table is constructed with given conditions and possible alternative solutions are
shown on the table. This is given as follows:
Conditions (Customer code=A, Type=1, Amount<=700) =Y else N
Customer Code = A Y Y Y Y N
Customer Type = 1 Y N Y N -
Order amount<=700 Y Y N N -
Actions
Discount = 5% x x
Discount = 7.5% x x
Discount = 10% x

Example-4
A company has three shareholders Ramu, Sita and Rabi. Ramu owns 30% share, Sita 20%
and Rabi 50%. They decide to lay down rules to pass laws for the company. For a law pass it
must be supported by shareholders the sum of whose holding exceed 2/3rd of total share. Write
a decision table for this rule.
Solution:
The decision table is constructed with given conditions and possible alternative solutions are
shown on the table. This is given as follows:
Conditions
Ramu owns 30% share Y Y N Y N
Sita owns 20% share Y N Y Y N
Rabi owns 50% share Y Y Y N N
Actions
Passed Law x x x
Reject Law x x

Example-5
Assume the tax system of any company as:
• If the employee is male and annual salary<=200000 then no income tax.
• If the employee is female and annual salary<=200000 then 5% income tax on total salary.
• If the employee is male and annual salary>200000 but <=300000 then 10% income tax
on total salary.
• If the employee is female and annual salary>200000 but <=300000 then 12% income tax
on total salary.
• If annual salary is more than 300000 then 20% income tax on total salary for all employee.

Programming Logics & Techniques 71


71
2 | Program/Software Development (Specification)

Solution:
The decision table is constructed with given conditions and possible alternative solutions are
shown on the table. This is given as follows:
Conditions Male=Y female= N
Employee male Y N Y N All
Annual Salary<=200000 Y Y N N N
Annual Salary>200000 and N N Y Y N
<=300000
Annual Salary>300000 N N N N Y
Actions
Income Tax = 0% (No Income tax) x
Income Tax = 5% x
Income Tax = 10% x
Income Tax = 12% x
Income Tax = 20% x

Pseudocode
There are four kinds of program analysis tools. They are algorithm, flowchart, Decision table
and pseudocode.
The pseudocode is one of the important and furnished tools among all the programming
analysis tools hence. "Pseudo" means imitation or false and "Code" means instruction to the
computers. Therefore, pseudocode is useful to analyse whether instruction is systematically
given to the computer or not. In conclusion, pseudocode is an imitation of actual computer
instruction. It is written in different general language like English, Nepali, German, French etc.
Pseudocode is the combination of following three logical structures.
• Sequential logical structure
• Selection logical structure
• Iteration logical structure

Sequential Logical Structure


This logic is used in pseudocode to form the program in sequential order. The order of
instructions is in top-bottom approach, not in bottom up approach. This type of logical
structure in pseudocode is known as sequential logical structure.

272
7 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Start

.
. Input
.
.
Process 1 Process 1

Process 2 Process 2
.
.
.
Process N
.

Output

End

a) Pseudocode b) Flow Chart


Selection Logical Structure
This logic is used to give specific output with satisfying certain condition in the program. Different
types of logical control system are used in the program. They are If…… Else, if…Then…
Else, Do-while, the switching case etc. The concept of decision is applied into the program
so it is known as decision logic structure.
.
. Yes
Condition
No
.
IF condition THEN ELSE

THEN Process 1 Process 1 Process 2


ELSE Process 2

ENDIF

. Output
.
.
a) Pseudocode b) Flow Chart
Programming Logics & Techniques 73
73
2 | Program/Software Development (Specification)

Iteration Logical Structure


This logic is similar to selection logic structure but it produces loops when one or more
instructions may be executed several times depending on some given conditions. The main
structure of iteration logic is controlled by do while statement.
1. Flowchart and pseudocode for DO…. WHILE iteration structure
.
.
.
False
Condition
DO WHILE condition
Process 1
. True
.
. Process 1
Process n

END DO Process 2
.
.
.
a) Pseudocode b) Flow Chart
2. Flowchart and pseudocode for REPEAT ……. UNTIL iteration structure
.
.
.
.
. Process 1
.
REPEAT
Process 1
.
.
.
. Process n
.
Process n
UNTIL Condition
.
.
. Condition?
.
.
a) Pseudocode b) Flow Chart

474
7 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Some Examples of Algorithm and Flow Chart


1) Write an algorithm to find out total & average mark of 10 students consisting of seven
subjects & print the result.
Step 1 : Start to write a program of Mark Sheet.
Step 2 : Assume subject = 1, total = 0, no. of subject = 1
Step 3 : Input the marks of the seven subjects.
Step 4 : Are all 7 subjects done?
If no, then increase the subject number & go to step 3, otherwise go to step 5.
Step 5 : Add & print sum or total.
Step 6 : Calculate the average of 7 subjects marks.
Step 7 : Are all 10 students marks entered?
If no, increase the student number & go to step 3, otherwise go to step 8.
Step 8 : End.
2) Write an algorithm to calculate BA, DA & NA from the given inputs S.No., Particular,
Qty & Rate. And convert into flow-chart.
Notification/Index
BA = Bill Amount
DA = Discount Amount
NA = Net Amount
Step 1 : Start to write a program to calculate BA, DA & NA from the given inputs
Step 2 : Input name, particular, qty., rate.
Step 3 : Calculate BA i.e. BA = qty * rate
Step 4 : Calculate DA i.e. DA = BA * 15/100
Step 5 : Calculate NA i.e. NA = BA-DA
Step 6 : Print the value particular, qty., rate, BA, DA, NA
Step 7 : End.
Start

Input Let, Particulars, qty & rate

Process-1 Let, BA = qty * rate

Process-2 Let, DA = BA * 15/100

Process-3 Let, NA = BA - DA

Display Let, particular, qty., rate, BA, DA, NA

End
Programming Logics & Techniques 75
75
2 | Program/Software Development (Specification)

3) Write an algorithm & convert it into flow-chart to calculate the following operations from
the given two numbers.
i) A * B ii) A–B
i) Step 1 : Start a program to multiply two numbers.
Step 2 : Read two numbers, let A & B.
Step 3 : Calculate the variables & store the result in C i.e. C = A*B
Step 4 : Display A, B & C
Step 5 : End.
Start

Input Let, A & B

Process Let, C = A * B

Display Let, A, B & C

End
ii) Step 1 : Start to write a program to subtract two numbers.
Step 2 : Input/Read two numbers, let A & B
Step 3 : Subtract two numbers & store result in C i.e. C = A-B
Step 4 : Display A, B & C
Step 5 : End.
Start

Input let, A & B

Process let, C = A - B

Display let, A, B & C

End

4) Write an algorithm & flow-chart from the given inputs like Emno, EmName, Address, Post
& BS. Calculate the following calculations assuming suitable inputs.
Notification
HRA = House Rent Allowance
DA = Daily Allowance

676
7 Programming Logics & Techniques
2 | Program/Software Development (Specification)

CEA = Child Education Allowance


TA = Travelling Allowance
MA = Medical Allowance
GS = Gross Salary
IT = Income Tax
PF = Provident Fund
TD = Total Deduction
NS = Net Salary
BS = Basic Salary
EM Name = Employment Name
Start

Input Let, Emno, EmName, Address, Post BS

Process-1 Let, DA = BS * 10/100

Process-2 Let, TA = BS * 12/100

Process-3 Let, CEA = BS * 13/100

Process-4 Let, MA = BS * 8/100

Process-5 Let, HRA = BS * 14/100

Process-6 Let, GS=(TA+CEA+MA+DA+HRA+BS)

Process-7 Let, IT = BS * 15/100

Process-8 Let, PF = BS * 20/100

Process-9 Let, TD = IT + PF

Process-10 Let, NS = GS - TD

Display Let, Emno, EmName, Address, Post TD, GS, NS

End

Programming Logics & Techniques 77


77
2 | Program/Software Development (Specification)

5) Write an algorithm from the given C.No., CName, PMMR & Rate. Calculate UC (Unit
Consumed) & BA in Nepal Electrical Board.

Notification
C.Name = Customer Name
CMMR = Current Month Meter Reading
PMMR = Previous Month Meter Reading

Step 1 : Start to write a program to calculate UC & BA


Step 2 : Input CMMR, PMMR, UC, BA & Rate
Step 3 : Calculate UC i.e. UC = CMMR - PMMR
Step 4 : Calculate BA i.e. BA = UC * Rate
Step 5 : Display UC, CMMR, PMMR, BA & Rate
Step 6 : End

6) Draw a flow-chart to add given three numbers for 50 times.

Start

N=1

Input Let, A, B, C

Process D=A+B+C
N = N+1
Display A, B, C & D

Yes if
(N<50)

No
End

878
7 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Flowchart with no Input Symbol:

7) Draw a flow-chart to display the following series of numbers.

1) 1, 2, 3, 4, 5 .......... 21 2) 2, 4, 6, 8, 10 ........... 100

Start Start

N=1 N=2

Display N Display N

N = N+1 N = N+2
Yes if Yes if
(N<21) (N<100)

No No
End End

3) 1 , 1 , 1 , 1 , 1 ..... 1
2 3 4 5 6 27

Start

N = 12

Display N
N=N
N +1
if
Yes
1
(N> 51 )

No
End

Programming Logics & Techniques 79


79
2 | Program/Software Development (Specification)

8) Draw a flow-chart to find out sum of the following series of numbers.


i) S = 1 + 2 + 3 + ....... 100 ii) S = 1 + 3 + 5 + ....... + 71
Start Start

S=0 S=0

N=1 N=1

S = S+N S = S+N

Display S Display S
N = N+1 N = N+2

Yes if Yes if
(N<100) (N<71)

No No
End End

9) Draw a flow-chart to make telephone call to your friend.
Start

Input Read telephone number

Process-1 Pick up the receiver


Put off
receiver if
No (Dial tone
exist)
Yes
Process-2 Dial telephone number

Redial
Yes if
(Busy)

No
Talk

End
080
8 Programming Logics & Techniques
2 | Program/Software Development (Specification)

10) Draw a flow-chart to find out odd or even number from the any given number.
Start

Input Read N

Process Let R = N 2

is Yes Display even


(R = 0)

No
Display odd

End

11) Draw a flow-chart to find out Fibonacci series of any given number n.
Start

Let i =1, a = 0, b= 1

Input n

c=a+b

Display a
i = i+1
a=b
b=c
>

Yes if
(i < = n)

No
Stop

Programming Logics & Techniques 81


81
2 | Program/Software Development (Specification)

12) Draw a flow-chart to find out greatest & smallest number from the given numbers.
i) Any given two numbers.
Start

Input Let, A, B

if
B is greatest No Yes A is greatest
(A > B)

Display Greatest Number

End

Flow-chart with More than Two Decision Boxes:


ii) Any given three numbers. iii) Any given four numbers.
Start Start

Input Let, A, B Input Let, A, B, C, D

Suppose
No if Yes Great = A
(A > B)
if Yes
if No if (B>Great) Great = B
(B > C) (A > C)
No
Yes Yes if Yes
B is great C is great A is great (C>Great) Great = C

No

Display Greatest Number if


Yes
(D>Great) Great = D

End
No
Display Great

End

282
8 Programming Logics & Techniques
2 | Program/Software Development (Specification)

Questions
Solve the following questions. (each question carries 7-8 Marks)
Write Short notes on the following: (each question carries 5 marks)
1. Define flowchart? Construct a flowchart to find Fibonacci series up to nth term.
2. What do you mean by feasibility analysis? Explain its different types.
3. What do you understand by program development? Does requirement analysis play
important role on system development? Justify your answer with suitable reasons.
4. Define iterative and recursive logic of program development with suitable examples.
5. What are the errors on computer program? Justify logical errors are more difficult to find
out than syntax errors in program testing.
6. Why is it essential to follow software development life cycle? How design and analysis
are related to each other? Illustrate your understanding with relevant examples.
7. Write down the flowchart to find the factorial of any given number. Explain.
8. Draw a flow chart to ask three numbers and find out the largest number.
9. Write an algorithm of telephone call system and convert it into equivalent flow chart
diagram.
10. What types of program designing tools are widely used for software development? Draw
a flow chart to ask marks obtained in any five subjects in Semester End Examination and
calculate total marks, percentage of marks and division where if:
percentage>=90 : ‘A Grade’
percentage>=80 & percentage <90 : ‘B Grade’
percentage>=70 & percentage<80 : ‘C Grade’
percentage>=60 & percentage<70 : ‘D Grade’
percentage>=45 & percentage<60 : ‘E Grade’ otherwise ‘Fail’.
11. A bank defined the rate of interest on fixed deposit account as follows.
a. If the amount is at least Rs.20,000 and time 1 year = 5%.
b. If the amount is at least Rs.20,000 and time 2 years = 7%.
c. If the amount is at least Rs.20,000 and time 3 years = 9%.
d. If the amount is at least Rs.20,000 and time 4 years = 10%.
e. There is no matter of amount if the time is more than 4 years 11%
Express these statements in the form of decision table.
12. An organization decided to increase the salary scale of its workers as follows:
a. For those workers whose annual salary is more than Rs. 40,000: no increment
b. For those workers whose annual salary is in between Rs. 20,000 and 30,000: an
increment of 5%.
c. For those workers whose annual salary is less than Rs. 10,000: an increment of 10%.
Express these statements in the form of decision table

Programming Logics & Techniques 83


83
2 | Program/Software Development (Specification)

13. Assume the tax system of any company as:


• If the employee is male and annual salary is <=2,00,000 then no income tax.
• If the employee is female and annual salary is <=2,00,000 then 5% tax on total salary.
• If the employee is male and salary is above 2,00,000 but <=3,00,000 then 10 % income
tax on total salary.
• If the employee is female and annual salary is above 2,00,000 but <=3,00,000 then 12
% income tax on the total salary.
• If annual salary is more than 3,00,000 then 20% income tax on total salary for all
employees.
Now construct a decision table to represent the above conditions.

Write Short Notes on the following: (each question caries 5 marks)


a. Program
b. Preliminary Investigation
c. Feasibility Study
d. Requirement Analysis
e. Program Designing Style and Presentation
f. System Design
g. Output Design
h. Type of Data Items
i. Program Coding
j. System Conversion
k. System Testing
l. System Implementation
m. System Evaluation
n. System maintenance
o. Programming Errors
p. Programming Tools
q. Flow Chart Building Blocks (Symbols)

484
8 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Programming Techniques
(Approaches) Unit-3

Objectives
This unit has following objectives:
1) To create the various techniques to develop a program
which can increase the program performance.
2) To make the students aware of programming techniques
(like modular, top-down, bottom-up, structure and object-
oriented programming techniques) and programming
models (like waterfall, prototype, spiral, iterative, V-model,
RAD, Big-bang, evolutionary models)
3) To generate the comparative studies of programming
techniques, and model so that they can easily identify
the advantages and disadvantages of them.
4) To boost knowledge about cohesion and coupling with
their types.
5) To identify internal relationship of modules for communi-
cation in programming.

Programming Logics & Techniques 85


85
3 | Program Techniques (Approaches)

Introduction
Any system is directly or indirectly associated with the method of development. Similarly, to
develop a complete efficient program, there are certain methods, logic skills and knowledge.
This special creation of a program development system is called as Programming Technique.
To build today's complex and efficient software, it is just not enough to put together a sequence
of programming statements and sets of procedures as well as modules; we need to incorporate
sound construction techniques and program structures, that are easy to comprehend, implement
and modify. The computer machine has itself remarkable versatility and ability to carry out
a specific sequence of calculations in short period of time without making any mistakes. Not
only this it has logical decision making and looping calculation power which automatically
guides the overall computing system.
Since, the invention of the computer, many programming approaches has been tried out.
Among them the following five types of programming approaches are being popular for
study. They are-
a. Modular Programming
b. Top-down programming
c. Bottom-up programming
d. Structured programming
e. Object Oriented Programming

Types of Programming Approaches


Modular Designing and Programming
It is the common type of programming technique. The similar group of instructions are grouped
together to form a module of a program. In this programming technique a big program is
divided into number of possible subprograms which are called modules. The main objective
of this programming technique is to make program in modular format. It means the number
of modules of programs is arranged in such a way that the ordering is absolutely matching to
develop a program. This technique is known as modular programming.
The modular programming is a process of decomposing a complex system into small and
simpler pieces of a system or program. The modules are written as programs within a program;
the main routine defines the order in which each of the modules (or subroutines) will be used.
In modular approach, large program is divided into many small discrete components called
Modules. In programming language, different names are used for it.
For example:
Q-basic, Fortran Subroutine
Pascal Procedure or Function
C, C+, C#, Java Function
It is logically separable part of program. Modules are independent and easily manageable.
686
8 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Generally, modules of 20 to 50 lines are considered as good modules. When lines are increased,
the controlling of module becomes complex.
Modules are debugged and tested separately and combined to build system. The top module is
called root or boss modules which charges control over all sub-modules from top to bottom.
The control flows from top to bottom, but not from bottom to top.
The modules are evaluated in terms of coupling and cohesion. The module coupling denotes
number of interconnections between modules and module cohesion shows relationship among
data or elements within a module.

Module

Elements
Cohesion
Coupling
Fig.: Coupling and Cohesion
Modular Programming
The modular designing and programming technique has following characteristics: -
1. A programmer is going to form number of levels to the complex program where a level
may consist of one or more modules. The first level of program is main level of a program
and modules at successive levels consist of sub modules, in the prior level.
2. As we know a module is a set of program statements acting together to complete a specific
task. Therefore, module can be a function of the main program which can consist of
sequence of calls to the functions, those modules at the next level down.
3. The number of modules are executed together and controlled by the main program. This
is the procedural system to solve all the problems in the program.
4. Modules should be structured within themselves by incorporating the construction of
sequencing, selection and repetition. These constructions are common for almost all
program design.
Advantages
It has following advantages:
1. Decreases the complexity of the program by breaking it down into smaller units.
2. Allows several programmers to code simultaneously.
3. Allows common functions to be written once and then used in all programs as per
requirement. For example, if decoding of the transaction code were to be performed for
several programs, the same module could be used.
4. Decreases debugging time, because modules make it easier to isolate errors.
5. Improves maintainability of the program.
Programming Logics & Techniques 87
87
3 | Program Techniques (Approaches)

Top down Programming Approach (Technique)


In the case of top-down design, the overall task of the program is broken down into number
of smaller logics and they are re-arranged in overlapping format. These logics can be called
whenever necessary, such technique of designing the program is known as Top-down
Programming Technique. There are some methods to develop a program through top-down
approach.
1. Start with a very short and simple statement and write the heading of a program that is
what the program does e.g.
" To calculate total mark of the students" This is the top first line of a program.
2. Write the program by following pseudocode principle. They are sequence logic, selection
logic and repetition or iteration logic. All the steps are to be explained in greater details,
so that program module can start to function by taking two principles entry and exit, that
is, a module should have just one entry point and just one exit point.
3. The stepwise repeating works are taken for module refining purpose known as stepwise
refinement. This process is very important to get sufficient details for the procedure to
complete the program development.
4. At the intermediate steps in the refinement, algorithms / flowcharts / pseudocodes are
used to represent the procedure.
5. At every step the unwanted details are left out.
6. Final testing of the program (module) is done to check up whether it is properly functioning
or not.
In another way top down approach also can be discussed:
(a) The large program is divided into many small modules or subprograms or functions or
procedures from top to bottom.
(b) At first supervisor program is identified to control other sub modules. Main modules are
divided into sub modules, sub-modules into sub-sub-modules. The decomposition of
modules continues untill desired module level is not obtained.
(c) Top module is tested first, and then sub-modules are combined one by one and tested.
Main Program

A B C

A1 A2 A3 B1 B2
C1 C2 C3
Fig.: Top down Approach
Example: The main program is divided into sub-programs A, B, and C. The A is divided
into subprogram A1, A2 and A3. The B is into B1, and B2. Just like these subprograms,
C is also divided into three subprogram C1, C2 and C3. The solution of Main program is
obtained from sub program A, B and C.

888
8 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Bottom-up Approach
In bottom up programming technique the overall work is broken down into different segments.
Bottom up programming technique starts with the smallest of programming logic which creates
new bigger logic to solve the next problem and so on till the entire problem is programmed.
A bottom up approach would be to write the most basic subroutines in the hierarchy first and
then use them to make more sophisticated subroutines.
A complex system may be divided into simpler pieces called modules. A system that is
composed of modules is called modular approach. The modules are in hiding nature, once the
smallest logic has been reached out, it creates the idea of bigger logic one. So, in programming
system the smaller logic doesn't play vital role after formation of bigger logic. This process is
called hiding process. It suggests that we should first recognize, what we wish to encapsulate
within the module and then provide an abstract interface to define the module boundaries.
Since, this technique of writing the program is highly effective in supporting design for
change, this type of technique is known as bottom-up programming technique.
Designing of a program from bottom up technique is highly critical and creative human
activity. Good designers don't proceed in a strictly top-bottom or strictly bottom-up fashion.
Both the program designing techniques are merged together and a new technique is
implemented which is called yo-yo program designing technique. For example, a system
is decomposed first into different phases of design by top-down approach and later on these
sub systems can be synthesized by principle of bottom-up programming approach is known
as yo-yo program designing technique.

Structured Programming Technique


It is the most popular and advanced programming technique in programming field. The concept
of structural programming was introduced in 1976, with the advent of programming language
such as C. The structured programming languages became very popular and were the main
technique of 1980s. Structured programming was a powerful tool that enabled programmers
to write moderately complex program fairly and easily. In this programming also, a whole
program is structured into number of understandable chunks called modules. Structured
design cannot reduce the overall complexity of a system but breaking it down into smaller
chunks (modules) means that the amount of details that the programmer has to understand for
any one module is much less than if dealing with the system as a whole. The job of modifying
or maintaining the program becomes easier, and as this is easy to understand, changes can be
made more quickly than if the program consisted of one long continuous pieces of code.
In 1976, Edsger Disikstra introduced the importance of using structure-programming
technique but he had started to apply this technique in his program from 1960. The basic
theory of structure programming was also applied by Italian computer scientist C Bohm (Carl
Bohm) and G Jacopini in 1966.

Programming Logics & Techniques 89


89
3 | Program Techniques (Approaches)

The structure-programming concept has following 3 basic structure:


a. Sequential Structure
b. Selection Structure
c. Repetition or Iterative Structure

(For More detail see above in pseudocode)


Advantages of structured programming technique:
a. It is easy to recognize the problems in the program.
b. It is more practical in use because the three systems are adopted to write a program which
is commonly necessary in almost all-programming techniques.
c. It is simple in nature because it has only one entry and exit point.
d. It is highly readable, easily errors debuggable and easily maintainable.
e. Due to the above techniques the program can be easily and efficiently developed within
the prescribed programming time period and budget
Q.1. Write a program to select tea, coffee and cold drink by applying structure-programming
technique and also prepare pseudocode.
Pseudocodes (selection)
Begin
Case Drink
(Tea)
Pour tea into a cup from kettle.
(Coffee)
Pour coffee into a cup from Kettle.
(Cold drink)
Take cold drink bottle from freeze.
End case
End
or
Begin
If Drink = Tea
Then
Pour tea into a cup from kettle
Else
If Drink = Coffee
Then
Pour coffee into a cup from kattle
Else
Take cold drink from freeze
Endif
Endif
End

090
9 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Program in C language
#include <stdio.h>
#include <conio.h>
void main ( )
{
char dr;
printf("Enter the drink");
scanf("%c",&dr);
switch(dr)
{
case 't':
printf("Pour tea from kettle");
break;
case 'c':
printf("Pour coffee from kettle");
break;
default:
printf("Take cold drink form freeze");
}
getch();
}

Object Oriented Programming


It is concluded that structured programming was a powerful tool that enabled programmers to
write moderately complex program fairly, easily. However, as the technology grew up, even
the structured programming approach failed to show the desired result in term of bug free,
and easy to maintain programs. Reusable programming technique has been introduced in the
programming field to overcome the problems of structured programming technique.
Hence the concept of object oriented programming technique was introduced in the
programming field to overcome the problems of structure programming technique.
Oops is an approach to program organizations and development that attempts to overcome
some of the limitations of conventional programming method by incorporating the best of
structured programming features with several powerful new concepts which is known as
object oriented language programming technique.

Program Development Methods (Model)/The Software Production Process


There are many steps and activities involved in building a software product. Generally
different types of activities are already discussed; they are software/program design, software/
program specification, software/program verification and validation.

Programming Logics & Techniques 91


91
3 | Program Techniques (Approaches)

All the above processes and steps are necessary to produce the software/program in order
to perform definite cycle of software development. Hence Software Production Process is
the collection of the processes of software production from building, delivery, and setup and
evolves to final retirement of the system.
The software production process will be successful when produced software is with high
reliability, predictability and efficiency. Production processes use different types of model
called software process models. This is sometimes called program development methods
which are discussed below.
• Water fall or Traditional model
• Prototype or Transformation model
• Spiral model.
• Iterative Model
• V-model
• RAD model
• Big Bang Model
• Evolutionary Models

Waterfall or Traditional Model


This model of program/software development was popularized in 1970's and is still a
reference model for most important engineering textbooks and slandered industrial practices.
This model is the first model for software production and concept was taken from beginning
of 1950's. Hence it is very popular for common practice of software production field.
In waterfall model the nature of incoming stages is arranged like a principle of waterfall that
falls from high-level to low level. It was introduced at first for software production purpose;
hence it is also known as traditional program development model. There are many variants of
the waterfall model depending on the organization and nature of requirement but the common
principles are same for all which is clearly described by the following figure.

Feasibility Study

Requirements Analysis Specification

Design Specification

Coding and Module Testing

Integration and System Testing

Delivery

Deployment and Maintenance


Fig.: Waterfall model
292
9 Programming Logics & Techniques
3 | Program Techniques (Approaches)

The life-cycle of the waterfall model is explained as follows:


Feasibility Study
The feasibility study is the initiating phase to start any kind of projects. It differs from
software developer to developer. The main purpose of this phase is to produce a feasibility
study document that directs overall features of a program.
The feasibility study should cover the following points.
i. Analysis of the problems
ii. Identifying alternative solutions.
iii. Estimating the required resources, cost and delivery data etc.
For the feasibility study, it is first necessary to analyze the problem at least at a global level.
Obviously, the more we understand the problem, the better we can identify alternative solution,
their cost and potential benefits to the user. Therefore, feasibility study is the ideal practice to
analyse the problem of the program. This task is usually done within limited time boundaries
and under pressure. So, result may not come appropriately.
Increasing of time period to analyse the program is also the increasing of cost of the project.
In feasibility study all the alternatives and infrastructure of the program should be mentioned
clearly. The most important feasibility study like Technical Feasibility, Economic Feasibility,
Operational Feasibility, Schedule/Time Feasibility etc., can be analysed appropriately.

Requirement Analysis and Specification


This covers a detailed study of the requirements. It identifies requirements of users and the
software for development. This activity is basically concerned with what is the system and
how it is functioning with respect to various aspects. Some of the important aspects are:
1. What is the input to the system?
2. What is the output expected?
3. What is the process required?
4. What are the problems of the project? etc.
Hence the requirement analysis phase deals the viability of a system. In this analysis phase
the requirement about input, process, output and troubleshooting are also considered. The
necessary details about input, process, output, problem identification and maintenance are
required for specification of the program.
To analyse the requirement and specification; software engineer should concentrate his/her
brain on the following two points:
a. It must be analysed and confirmed by the customer in order to verify whether it
captures all of the customers' expectations.
b. Whether developed solution meets the requirements.
The customer is going to handover a document to the software engineer by describing the fol-
lowing items like understandable, precise, complete consistent and unambiguous format etc.
about the program. This document is known as requirement specification document.
Programming Logics & Techniques 93
93
3 | Program Techniques (Approaches)

From the above discussion it is concluded that the possible checklist of the contents is the
requirement specification document that might guide in its production.
The following three points are the important points to check up the possible checklist which
are used in requirement analysis.
I. Functional requirements:
This describes about functional behavior of the production system. It means the most
necessary requirement of the program or software or system. To achieve the knowledge
about it the programmer should know what the product does by using informal
semiformal, formal notations or suitable mixtures.
II. Nonfunctional/Unfunctional requirement:
It is additional requirement of the system. The nonfunctional requirement mostly covers
the following heading:
a. Reliability (availability, integrity, security, safety etc.)
b. Accuracy of a result
c. Performance
d. Human computer interface issues.
e. Operating constraints (Problems)
f. Physical constraints
g. Portability issues and others.
III. Requirement on the development and maintenance process
It includes quality control process such as system test process, system maintenance
process and other requirements.

Design Specification
It is the most creative process. This is the important phase to produce the software. In this phase
the overall design of the software is done. Here different types of programming technique
may be used such as top-bottom, bottom up, modular, structure, object oriented etc. but first
of all design specification is started by breaking down a big program into smaller section
known as module. This phase also deals with various concepts of the system design, such
as data structure, software architecture, algorithm etc. This phase translates the requirement
specification into a representation of a software. This stage answers the question of how, in
suitable format.

Coding and Module Testing


This is the phase where the software design format is translated into machine related format.
Therefore, we can say that actual programming section starts from here. The overall design
of the software is converted into computer programs by using a computer language. This is
the first phase of the early programming process but it's just one of the several phases into a
waterfall process.
The designed module is first coded and tested one after another.

494
9 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Integration and System Testing


In this testing, all the modules are integrated and final testing is done. This testing of program
is known as integration and system testing of program. The integration and system testing is
done by following two ways: -
• On the basis of problem selection and identification.
• On the basis of integrated modules.
The system testing is done to run application so that actual problems can be easily identified
and debugged.

Delivery and Maintenance:


Supplying software to the customer is known as delivery system. It is done in two ways:
a) Delivering the software to the selected group of customers to its official release.
This testing is very important to identify the problems and errors of a program before
software market release. This kind of system testing is done by selected number of
customers is known as Beta Testing.
b) Delivery of Software after Official Release
After Beta testing the software is published into the market for final selling even to
the general customer.
Any type of supports after the selling of software to the customer is known as maintenance.
Basically, maintenance consists of correcting of any remaining errors in the system like
changing, improving, adding, modifying the program etc.

Advantages
The advantage of waterfall development is that it allows for departmentalization and
managerial control. A schedule can be set with deadlines for each stage of development and a
product can proceed through the development process like a car in a carwash, and theoretically,
be delivered in time. Development moves from concept, through design, implementation,
testing, installation, troubleshooting, and ends up in operation and maintenance. Each phase
of development proceeds in strict order, without any overlapping or iterative steps.
Some of the major advantages of the Waterfall Model are as follows
• Simple and easy to understand and use
• Easy to manage due to the rigidity of the model. Each phase has specific deliverables
and a review process.
• Phases are processed and completed one at a time.
• Works well for smaller projects where requirements are very well understood.
• Clearly defined stages.
• Well understood milestones.
• Easy to arrange tasks.
• Processes and results are well documented.

Programming Logics & Techniques 95


95
3 | Program Techniques (Approaches)

Disadvantages
The major disadvantages of the Waterfall Model are as follows:
• No working software is produced until late during the life cycle.
• High amounts of risk and uncertainty.
• Not a good model for complex and object-oriented projects.
• Poor model for long and ongoing projects.
• Not suitable for the projects where requirements are at a moderate to high risk of
changing. So, risk and uncertainty is high with this process model.
• It is difficult to measure progress within stages.
• Cannot accommodate changing requirements.
• Adjusting scope during the life cycle can end a project.
• Integration is done as a "big-bang. at the very end, which doesn't allow identifying
any technological or business bottleneck or challenges early.
The Waterfall Model was the first Process Model to be introduced. It is also referred to as
a linear-sequential life cycle model. It is very simple to understand and use. In a waterfall
model, each phase must be completed before the next phase can begin and there is no
overlapping in the phases.
The Waterfall model is the earliest SDLC approach that was used for software development.
The waterfall Model illustrates the software development process in a linear sequential flow.
This means that any phase in the development process begins only if the previous phase is
complete. In this waterfall model, the phases do not overlap.

Waterfall Model - Design with Feedback


Waterfall approach was first SDLC Model to be used widely in Software Engineering to
ensure success of the project. In "The Waterfall" approach, the whole process of software
development is divided into separate phases. In this Waterfall model, typically, the outcome
of one phase acts as the input for the next phase sequentially.
The sequential phases in Waterfall model are:
Requirement Gathering and analysis − All possible requirements of the system to be
developed are captured in this phase and documented in a requirement specification document.
System Design − The requirement specifications from first phase are studied in this phase and
the system design is prepared. This system design helps in specifying hardware and system
requirements and helps in defining the overall system architecture.
Implementation − With inputs from the system design, the system is first developed in small
programs called units, which are integrated in the next phase. Each unit is developed and
tested for its functionality, which is referred to as Unit Testing.
Integration and Testing − All the units developed in the implementation phase are integrated
into a system after testing each unit. Post integration of the entire system is tested for any
faults and failures.

696
9 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Deployment of system − Once the functional and non-functional testing are done; the product
is deployed in the customer environment or released into the market.
Maintenance − There are some issues which come up in the client environment. To fix those
issues, patches are released. Also, to enhance the product some better versions are released.
Maintenance is done to deliver these changes in the customer environment.
All these phases are cascaded to each other in which progress is seen as flowing steadily
downwards (like a waterfall) through the phases. The next phase is started only after the
defined set of goals are achieved for previous phase and it is signed off, so the name “Waterfall
Model”. In this model, phases do not overlap.
The following illustration is a representation of the different phases of the Waterfall Model.

Requirement
Analysis
System
Design

Implementation

Testing

Deployment

Maintenance
Fig: Waterfall Model with Feedback
Waterfall Model - Application
Every software development is different and requires a suitable SDLC approach to be followed
based on the internal and external factors. Some situations where the use of Waterfall model
is most appropriate are:
• Requirements are very well documented, clear and fixed.
• Product definition is stable.
• Technology is understood and is not dynamic.
• There are no ambiguous requirements.
• Ample resources with required expertise are available to support the product.
• The project is short.
• Process and results are well documented.
Programming Logics & Techniques 97
97
3 | Program Techniques (Approaches)

Prototype Model
Generally; each and every design system is tested and implemented after completing the whole
task of system design. But in this special type of program development model, a functionally
independent module is designed, developed, tested and implemented. This module can work
independently. This model of program development system is popularly known as prototype
model of program development. The process of making individual working module is known
as prototyping.

What is Software Prototyping?


Prototype is a working model of software with some limited functionality.
The prototype does not always hold the exact logic used in the actual software application and
is an extra effort to be considered under effort estimation.
Prototyping is used to allow the users evaluate developer proposals and try them out before
implementation.
It also helps understand the requirements which are user specific and may not have been
considered by the developer during product design.
The concept about prototype model and its system flow mechanism is as shown in fig below:

System
Specification
Outline
Requirement

Design Prototype
Model

Build Prototype

Make a detailed
Design

Evaluate Full System


Prototype

Fig: Prototype Model

898
9 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Advantages
Software prototyping is used in typical cases and the decision should be taken very carefully
so that the efforts spent in building the prototype add considerable value to the final software
developed. The model has its own pros and cons discussed as follows.

The advantages of the Prototyping Model are as follows:


Increased user involvement in the product even before its implementation. Since a working
model of the system is displayed, the users get a better understanding of the system being
developed.
1. Quicker user feedback is available leading to better solutions.
2. Missing functionality can be identified easily.
3. We can produce understandable specifications which are correct and complete as far
as possible.
4. Maintenance charges that require when a system is installed are minimized.
5. Development engineers can work from a set of specifications which has been tested
and approved.
6. It is less time-consuming process.
7. It is cheaper than other models.
8. It is Improved and increased user involvement model

Disadvantages of prototyping
The Disadvantages of the Prototyping Model are as follows :
• Risk of insufficient requirement analysis owing to too much dependency on the
prototype.
• Users may get confused in the prototypes and actual systems.
• Practically, this methodology may increase the complexity of the system as scope of
the system may expand beyond original plans.
• Developers may try to reuse the existing prototypes to build the actual system, even
when it is not technically feasible.
• The effort invested in building prototypes may be too much if it is not monitored
properly.
To avoid the above problems the developer and the client should both establish a protocol,
which indicates the deliverables to the client as well as contractual obligations.
In both versions the prototype is discarded early in the life cycle. However, one way of
ensuring that the product is properly designed and implemented is to implement the prototype
in a different programming language from that of the product.

Types of Prototyping Software Development Model


There are different types of software prototypes used in the industry. Following are the major
software prototyping types used widely:

Programming Logics & Techniques 99


99
3 | Program Techniques (Approaches)

• Throwaway/Rapid Prototyping
Throwaway prototyping is also called rapid or close ended prototyping. This type of
prototyping uses very little efforts with minimum requirement analysis to build a prototype.
Once the actual requirements are understood, the prototype is discarded and the actual system
is developed with a much clear understanding of user requirements.
• Evolutionary Prototyping
Evolutionary prototyping also called breadboard prototyping is based on building actual
functional prototypes with minimal functionality in the beginning. The prototype developed
forms the heart of the future prototypes on top of which the entire system is built. By using
evolutionary prototyping, the well-understood requirements are included in the prototype and
the requirements are added as and when they are understood.
• Incremental Prototyping
Incremental prototyping refers to building multiple functional prototypes of the various sub-
systems and then integrating all the available prototypes to form a complete system.
• Extreme Prototyping
Extreme prototyping is used in the web development domain. It consists of three sequential
phases. First, a basic prototype with all the existing pages is presented in the HTML format.
Then the data processing is simulated using a prototype services layer. Finally, the services are
implemented and integrated to the final prototype. This process is called Extreme Prototyping
used to draw attention to the second phase of the process, where a fully functional UI is
developed with very little regard to the actual services.
When to use Prototype Model:  
Prototype model should be used when the desired system needs to have a lot of interaction
with the end users.
Typically, online systems, web interfaces have a very high amount of interaction with end
users, are best suited for Prototype model. It might take a while for a system to be built that
allows ease of use and needs minimal training for the end user.
Prototyping ensures that the end users constantly work with the system and provide a feedback
which is incorporated into the prototype to result in a usable system. They are excellent for
designing good human computer interface systems.
A prototype is a scaled down version of the system and may have number of systematic
performance criteria and resource requirements. Developer and customer agree upon certain
outline specification of the system and a prototype design is proposed with the outline
requirements and available resources. The prototype is built and evaluated with the reference
to above resources. The major interest is not in the prototype itself but in its performance,
which is used to refine the requirement specification. Prototype provides an opportunity
to experiment and analyse various aspects of the system such as system structure, internal
design, hardware requirements and the final system requirements.
Simply, a prototype is a working model that is functionally equivalent to a component of the
product.
00100
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

In many instances the client only has a general view of what is expected from the software
product. In such a scenario where there is an absence of detailed information regarding the
input to the system, the processing needs and the output requirements, the prototyping model
may be employed. This model reflects an attempt to increase the flexibility of the development
process by allowing the client to interact and experiment with a working representation of
the product. The developmental process only continues once the client is satisfied with the
functioning of the prototype. At that stage the developer determines the specifications of the
client’s real needs.
The following sections examine two (2) version of the prototyping model:
Version I: Prototyping is used as a requirements technique.
Version II: Prototype is used as the specifications or a major part thereof.

Version I
This approach, as illustrated in figure below, uses the prototype as a means of quickly
determining the needs of the client; it is discarded once the specifications have been agreed
on. The emphasis of the prototype is on representing those aspects of the software that will be
visible to the client/user (e.g. input approaches and output formats). Thus, it does not matter
if the prototype hardly works.
Note that if the first version of the prototype does not meet the client’s needs, then it must be
rapidly converted into a second version.

Changed
Requirements
Requirements Verify

Rapid Specifications
Prototyping (written)
Verify Verify

Design
Verify

Implementation
Test
Development Integration
Maintenance Test

Maintenance

Fig : Prototyping Model Version I

Programming Logics & Techniques 101


101
3 | Program Techniques (Approaches)

Version II
In this approach, as illustrated in figure below, the prototype is actually used as the specifications
for the design phase. The advantage of this approach is speed and accuracy, as not time is
spent on drawing up written specifications. The inherent difficulties associated with that phase
(i.e. incompleteness, contradictions and ambiguities) are then avoided.

Changed
Requirements
Requirements Verify

Rapid
Prototyping Design
Verify Verify

Implementation
Test

Integration
Development Test

Maintenance Maintenance

Fig : Prototyping Model Version II

Conclusion
Prototype is meant for experimenting. Most often it can't be formed into a product. Occasionally
it may be possible to tune a prototype into a final product.

Spiral Model
This is another type of important software production process, which is guided by the risk
analysis levels in the project. The basic principle of this model is to analyse the risk factor
to the series of development in the process. The spiral model, also known as the spiral life-
cycle model, is a systems development method (SDM) used in information technology (IT).
This model of development combines the features of the prototyping model and the waterfall
model. The spiral model is intended for large, expensive, and complicated projects.
The risk analysis process in the development of any system refines the process and produces
a quality product. Barry Boehm (1986-1989) defines risk management which describe about
objectives, addresses, problems of the project or software production method. Obviously
spiral model of program development is defined in such a way that it eliminates high risk or
problem by the careful process design rather than treating both trivial (smallest), severe and
complex problems uniformly.

20102
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

The main characteristic of the spiral model is that it is in cyclic order and does not create
linear system as in waterfall model. Each cycle of the spiral consist of 4 stages and each stage
is represented by 1 quadrant of the Cartesian diagram. The radius of the spiral represents the
cost accumulated so far in the process, the angular dimension represents the progress in the
process.
The spiral model is explained under following 4 stages. They are prototype 1, prototype 2,
prototype 3 and operation prototype.
From prototype 1, the stage of development of software production is started. These are
explained by following series of operations, concept of operation, requirement plan, and life
cycle plan and risk analysis.
In stage 2, it is started from software requirement and validation, development plan and risk
analysis. Similarly, all the stages are proceeding ahead. The spiral model clearly describes the
process of stages to produce particular output in the project. Once it has crossed one stage,
it also analyses the risk factor along with. As soon as the process reaches the 4th stage then
process density system highly increases. This is clearly given in the diagram. In that quadrant
itself it has following series of tasks such as detailed design, coding, unit test, integration test,
acceptance test and final implementation of the software (release version of software).
Finally, in spiral model the process of software production process will continue in cyclic
order to obtain specific result of the system. Each stage is purified by series of risk analysis
processes. Hence, this design system has negligible problems which appear in the end
compared to other program development models.

Phases of Spiral Model


It has following four phases:
Spiral Model Phases Activities Performed during Phases
Planning It includes estimating the cost, schedule and resources for
the iteration. It also involves understanding the system
requirements for continuous communication between the
system analyst and the customer
Risk Analysis Identification of potential risk is done while risk mitigation
strategy is planned and finalized
Engineering It includes testing, coding and deploying software at the
customer site
Evaluation Evaluation of software by the customer. Also, includes
identifying and monitoring risks such as scheduled slippage
and cost overrun

Programming Logics & Techniques 103


103
3 | Program Techniques (Approaches)

Planning Phase Risk Analysis Phase


Cumulative cost

Determine
objectives, Identify and
alternatives and resolve risks
constrains
Risk
analyses
Risk
Commit to an analyses Evaluate
appraoch Risk alternatives
for the next analyses Operational
iteration Risk prototype
analyses Prototype 3
Prototype 2
Review START Prototype 1
Partition Simulations,
Requirements Concept of models,
plan, life-cycle operation benchmarks
plan
Detailed
Plan the next design
iteration Development
plan Code
Unit
Integration test
and test plan Integration
and test Develop the
Acceptance deliverables for the
test iteration and verify
Release that they are correct

Evaluation Phase Engineering Phase

Fig : Spiral Model


Advantages and Disadvantages (Pitfalls) of Spiral Model
Advantages Disadvantages
Additional functionality or changes can be Risk of not meeting the schedule or budget
done at a later stage
Cost estimation becomes easy as the It works best for large projects only, also
prototype building is done in small fragments demands risk assessment expertise
Continuous or repeated development helps For its smooth operation spiral model
in risk management protocol needs to be followed strictly
40104
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Development is fast and features are added Documentation is more as it has intermediate
in a systematic way phases
There is always a space for customer It is not advisable for smaller project, it
feedback might cost them a lot.

Steps of Spiral Model


The steps in the spiral model can be generalized as follows:
The new system requirements are defined in as much detail as possible. This usually involves
interviewing a number of users representing all the external or internal users and other aspects
of the existing system.
A preliminary design is created for the new system.
The first prototype of the new system is constructed from the preliminary design. This is
usually a scaled-down system, and represents an approximation of the characteristics of the
final product.
The second prototype is evolved by a fourfold procedure: (1) evaluating the first prototype
in terms of its strengths, weaknesses, and risks; (2) defining the requirements of the second
prototype; (3) planning and designing the second prototype; (4) constructing and testing the
second prototype.
At the customer's option, the entire project can be aborted if the risk is deemed too great. Risk
factors might involve development cost overruns, operating-cost miscalculation, or any other
factor that could, in the customer's judgment, result in a less-than-satisfactory final product.
The existing prototype is evaluated in the same manner as was the previous prototype, and, if
necessary, another prototype is developed from it according to the fourfold procedure outlined
above.
The preceding steps are iterated until the customer is satisfied that the refined prototype
represents the final product desired.
The final system is constructed, based on the refined prototype.
The final system is thoroughly evaluated and tested. Routine maintenance is carried out on a
continuing basis to prevent large-scale failures and to minimize downtime.

When to use Spiral-SDLC Model?


• When project is large.
• When releases are required to be frequent
• When creation of a prototype is applicable
• When risk and costs evaluation is important
• For medium to high-risk projects
• When requirements are unclear and complex
• When changes may require at any time
Programming Logics & Techniques 105
105
3 | Program Techniques (Approaches)

• When long term project commitment is not feasible due to changes in economic priorities
• Users are unsure of their needs
• New product line
• Significant changes are expected (research and exploration)
Applications
For a typical shrink-wrap application, the spiral model might mean that you have a rough-
cut of user elements (without the polished / pretty graphics) as an operable application, add
features in phases, and, at some point, add the final graphics. The spiral model is used most
often in large projects. For smaller projects, the concept of agile software development is
becoming a viable alternative. The US military has adopted the spiral model for its Future
Combat Systems program.
Iterative Model
In the Iterative model, iterative process starts with a simple implementation of a small set of
the software requirements and iteratively enhances the evolving versions until the complete
system is implemented and ready to be deployed.
An iterative life cycle model does not attempt to start with a full specification of requirements.
Instead, development begins by specifying and implementing just part of the software, which
is then reviewed to identify further requirements. This process is then repeated, producing a
new version of the software at the end of each iteration of the model.
Iterative Model - Design
Iterative process starts with a simple implementation of a subset of the software requirements
and iteratively enhances the evolving versions until the full system is implemented. At each
iteration, design modifications are made and new functional capabilities are added. The basic
idea behind this method is to develop a system through repeated cycles (iterative) and in
smaller portions at a time (incremental).
The following illustration is a representation of the Iterative and Incremental model:
Build 1 Design &
Testing Implementation
Development

Build 2 Design &


Requirements Testing Implementation
Development

Build 3 Design &


Testing Implementation
Development

Fig.: Iterative Model


60106
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Iterative and Incremental development is a combination of both iterative design or iterative


method and incremental build model for development. "During software development, more
than one iteration of the software development cycle may be in progress at the same time." This
process may be described as an "evolutionary acquisition" or "incremental build" approach."
In this incremental model, the whole requirement is divided into various builds. During each
iteration, the development module goes through the requirements, design, implementation and
testing phases. Each subsequent release of the module adds function to the previous release.
The process continues till the complete system is ready as per the requirement.
The key to a successful use of an iterative software development life-cycle is rigorous
validation of requirements, and verification & testing of each version of the software against
those requirements within each cycle of the model. As the software evolves through successive
cycles, tests must be repeated and extended to verify each version of the software.
V-Model
The V-model is an SDLC model where execution of processes happens in a sequential manner
in a V-shape. It is also known as Verification and Validation model.
The V-Model is an extension of the waterfall model and is based on the association of a testing
phase for each corresponding development stage. This means that for every single phase in
the development cycle, there is a directly associated testing phase. This is a highly-disciplined
model and the next phase starts only after completion of the previous phase.
V-Model - Design
Under the V-Model, the corresponding testing phase of the development phase is planned in
parallel. So, there are Verification phases on one side of the ‘V’ and Validation phases on the
other side. The Coding Phase joins the two sides of the V-Model.
The following illustration depicts the different phases in a V-Model of the SDLC.

Fig.: V-Model - Verification Phases

Programming Logics & Techniques 107


107
3 | Program Techniques (Approaches)

There are several Verification phases in the V-Model, each of these are explained in detail
below.

Business Requirement Analysis


This is the first phase in the development cycle where the product requirements are understood
from the customer’s perspective. This phase involves detailed communication with the
customer to understand his expectations and exact requirements. This is a very important
activity and needs to be managed well, as most of the customers are not sure about what
exactly they need. The acceptance test design planning is done at this stage as business
requirements can be used as an input for acceptance testing.

System Design
Once you have the clear and detailed product requirements, it is time to design the complete
system. The system design will have the understanding and detailing the complete hardware
and communication setup for the product under development. The system test plan is
developed based on the system design. Doing this at an earlier stage leaves more time for the
actual test execution later.

Architectural Design
Architectural specifications are understood and designed in this phase. Usually more than one
technical approach is proposed and based on the technical and financial feasibility, the final
decision is taken. The system design is broken down further into modules taking up different
functionality. This is also referred to as High Level Design (HLD).
The data transfer and communication between the internal modules and with the outside
world (other systems) is clearly understood and defined in this stage. With this information,
integration tests can be designed and documented during this stage.
Module Design
In this phase, the detailed internal design for all the system modules is specified, referred
to as Low Level Design (LLD). It is important that the design is compatible with the other
modules in the system architecture and the other external systems. The unit tests make an
essential part of any development process and help eliminate the maximum faults and errors
at a very early stage. These unit tests can be designed at this stage based on the internal
module designs.
Coding Phase
The actual coding of the system modules designed in the design phase is taken up in the
Coding phase. The best suitable programming language is decided based on the system and
architectural requirements.
The coding is performed based on the coding guidelines and standards. The code goes through
numerous code reviews and is optimized for best performance before the final build is checked
into the repository.
80108
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Validation Phases
The different Validation Phases in a V-Model are explained in detail below.

Unit Testing
Unit tests designed in the module design phase are executed on the code during this validation
phase. Unit testing is the testing at code level and helps eliminate bugs at an early stage,
though all defects cannot be uncovered by unit testing.

Integration Testing
Integration testing is associated with the architectural design phase. Integration tests are
performed to test the coexistence and communication of the internal modules within the system.

System Testing
System testing is directly associated with the system design phase. System tests check the
entire system functionality and the communication of the system under development with
external systems. Most of the software and hardware compatibility issues can be uncovered
during this system test execution.

Acceptance Testing
Acceptance testing is associated with the business requirement analysis phase and involves
testing the product in user environment. Acceptance tests uncover the compatibility issues
with the other systems available in the user environment. It also discovers the non-functional
issues such as load and performance defects in the actual user environment.

RAD Model
The RAD (Rapid Application Development) model is based on prototyping and iterative
development with no specific planning involved. The process of writing the software itself
involves the planning required for developing the product.
Rapid Application Development focuses on gathering customer requirements through
workshops or focus groups, early testing of the prototypes by the customer using iterative
concept, reuse of the existing prototypes (components), continuous integration and rapid
delivery.

What is RAD?
Rapid application development is a software development methodology that uses minimal
planning in favor of rapid prototyping. A prototype is a working model that is functionally
equivalent to a component of the product.
In the RAD model, the functional modules are developed in parallel as prototypes and are
integrated to make the complete product for faster product delivery. Since there is no detailed
preplanning, it makes it easier to incorporate the changes within the development process.

Programming Logics & Techniques 109


109
3 | Program Techniques (Approaches)

RAD projects follow iterative and incremental model and have small teams comprising
of developers, domain experts, customer representatives and other IT resources working
progressively on their component or prototype.
The most important aspect for this model to be successful is to make sure that the prototypes
developed are reusable.

RAD Model Design


RAD model distributes the analysis, design, build and test phases into a series of short,
iterative development cycles.
Following are the various phases of the RAD Model :
Business Modeling
The business model for the product under development is designed in terms of flow of
information and the distribution of information between various business channels. A
complete business analysis is performed to find the vital information for business, how it
can be obtained, how and when the information is processed and what the factors driving
successful flow of information are.

Data Modeling
The information gathered in the Business Modeling phase is reviewed and analyzed to form
sets of data objects vital for the business. The attributes of all data sets are identified and
defined. The relation between these data objects are established and defined in detail in
relevance to the business model.

Process Modeling
The data object sets defined in the Data Modeling phase are converted to establish the business
information flow needed to achieve specific business objectives as per the business model.
The process model for any changes or enhancements to the data object sets is defined in this
phase. Process descriptions for adding, deleting, retrieving or modifying a data object are
given.

Application Generation
The actual system is built and coding is done by using automation tools to convert process and
data models into actual prototypes.

Testing and Turnover


The overall testing time is reduced in the RAD model as the prototypes are independently
tested during every iteration. However, the data flow and the interfaces between all the
components need to be thoroughly tested with complete test coverage. Since most of the
programming components have already been tested, it reduces the risk of any major issues.

01110
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

The following illustration describes the RAD Model in detail.

Business Business Business


Modeling Modeling Modeling

Data Data Data


Modeling Modeling Modeling

Process Process Process


Modeling Modeling Modeling

Application Application Application


Generation Generation Generation

Testing and Testing and Testing and


Turnover Turnover Turnover
Prototype 1 Prototype 2 Prototype 3

Application
Automation Tool
Code

Fig.: RAD Model

RAD Model Vs Traditional SDLC


The traditional SDLC follows a rigid process model with high emphasis on requirement
analysis and gathering before the coding starts. It puts pressure on the customer to sign off the
requirements before the project starts and the customer doesn’t get the feel of the product as
there is no working build available for a long time.
The customer may need some changes after he gets to see the software. However, the change
process is quite rigid and it may not be feasible to incorporate major changes in the product
in the traditional SDLC.
The RAD model focuses on iterative and incremental delivery of working models to the
customer. This results in rapid delivery to the customer and customer involvement during the
complete development cycle of product reducing the risk of non-conformance with the actual
user requirements.

Big Bang Model


The Big Bang model is an SDLC model where we do not follow any specific process. The
development just starts with the required money and efforts as the input, and the output is
Programming Logics & Techniques 111
111
3 | Program Techniques (Approaches)

the software developed which may or may not be as per customer requirement. This Big
Bang Model does not follow specific process, there is very little planning required. Even the
customer is not sure about what exactly he wants and the requirements are implemented on
the fly without much analysis.
Usually this model is followed for small projects where the development teams are very small.

Big Bang Model ─ Design and Application


The Big Bang Model comprises focusing all the possible resources in the software development
and coding, with very little or no planning. The requirements are understood and implemented
as they come. Any changes required may or may not need to revamp the complete software.
This model is ideal for small projects with one or two developers working together and
is also useful for academic or practice projects. It is an ideal model for the product where
requirements are not well understood and the final release date is not given.

Evaluation Model
The evolution tree model, is a two-dimensional software life-cycle model which considers
the software development process as continuous evolution of artifacts. It is viewed as a
maintenance-oriented process based on a tree of engineering decisions made at various times.
Software engineers in response to modifications in the requirements from the customer make
these decisions, as they receive revised requirements from the customer from time to time.
The software product evolves gradually as its versions keep on developing.

Evolutionary Model - Software Testing


Initial
Requirements
New Requirements
Customer Feedback

Development No

Customer Acceptable to
Application Values Customer

Yes

Base Line
The Application
Fig.: Evolutionary Model
21112
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Cohesion and Coupling


Cohesion
Cohesion can be defined as the degree of the closeness of the relationship between its
components. In general, it measures the relationship strength between the pieces of
functionality within a given module in the software programming. It is an ordinal type of
measurement, which is described as low cohesion or high cohesion.
In a good module, the various parts having high cohesion is preferable due to its association
with many desirable traits of the software such as reliability, reusability, robustness and
understandability. On the other hand, a low cohesion is associated with the undesirable traits,
including difficulty in maintaining, reusing and understanding. If the functionalities embedded
in a class have much in common, then the cohesion will be increased in a system.
Cohesion has close relation with the coupling, which is completely a different concept. Low
cohesion often correlates with the loose coupling and vice versa. Here are some advantages
of the high cohesion
i. High cohesion leads to the increased module reusability because the developers of the
application will easily find the component they look for in the cohesive set of operations
offered by the module.
ii. The system maintainability will be increased due to logical changes in the domain effecting
fewer modules.
iii. The module complexity also reduces, when there is a high cohesion in the programming.

Coupling
In software engineering, the coupling can be defined as the measurement to which the
components of the software depend upon each other. Normally, the coupling is contrasted
with the cohesion. If the system has a low coupling, it is a sign of a well-structured computer
system and a great design. A low coupling combined with the high cohesion, supports the
mission of high readability and maintainability. The coupling term generally occurs together
with the cohesion very frequently.
The coupling is an indication of the strength of the interconnection between all the components
in a system. The highly coupled systems have interconnections, in which the program units
depend upon each other, whereas in the loosely coupled systems made up of components, that
are independent of each other and have no dependence on each other.
In software production or program development system there are different kinds of relation-
ship of one module to another module to obtain specified output. For example, a program is
developed with the combination of sequential logical structure, selection logical structure and
iteration logical structure. In a program, single logic, combination of any two or combination
of all three logical structures is related to a particular task. That is known as inter-relationship
of the logical structure.
Programming Logics & Techniques 113
113
3 | Program Techniques (Approaches)

Obviously, more the relationship among them increases the complexity of the program to
understand, modification, testing and maintenance. The better relationship of program
modules is known as high coupling nature. The logical structure with high coupling figure is
given below.

Fig. High coupling but reasonable cohesion

Similarly, in the general figures, fig (a) has high coupling but less cohesion and fig(b) has low
coupling with high cohesion nature.


Fig (a) Fig (b)
The cohesion is the standard feature of the module in the program. A module has high cohesion
if all of its elements have relatively stronger declaration and are grouped together in the same
module for a logical reason; not just by chance, they co-operate with each other to achieve a
common goal which is the function of the module.
However, cohesion is an internal property of a module, coupling characterizes a module's
relationship to other modules. Coupling measures, the inter dependence of two or more
modules with each other.
It is concluded that to achieve modular composability, decomposability and understanding,
modules must have high cohesion but less coupling.
[e.g.' House wiring- high cohesion and less coupling.]
This diagram creates more concept clear between coupling and cohesion.
Module 1 Module 2

A B C
Cohesion
Coupling
E F
D
G
Module 3 Module 4
Fig.: Coupling and Cohesion among the Modules

41114
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Difference between Cohesion and Coupling


Cohesion Coupling
1. It is internal property of module. 1. It is inter-relationship of modules.
2. More cohesion expresses strength of the 2. More coupling express the complexity
elements in the module. and compactness of module.
3. To get better performance of the 3. To get better system analysis
program high cohesion is needed. understanding, modification, testing etc.
of the program low coupling is needed.
4. In high cohesion system analysis 4. In high coupling system analysis
understanding, modification, testing etc. understanding, modification, testing
of the program is not so difficult. etc. of the program is very difficult.
5. Cohesion is Intra-Module Concept. 5. Coupling is inter-module concept.
6. Cohesion is a degree (quality) to which 6. Coupling is a degree to which a
a component / module focuses on component / module is connected to
the single thing. the other modules.

In computer science, coupling or dependency is the degree to which each program module
relies on each one of the other modules.
Coupling is usually contrasted with cohesion. Low coupling often correlates with high
cohesion, and vice versa. The software quality metrics of coupling and cohesion were invented
by Larry Constantine, an original developer of Structured Design, who was also an early
proponent of these concepts.

Low coupling
Coupling can be "low" (also "loose" and "weak") or "high" (also "tight" and "strong").
Low coupling refers to a relationship in which one module interacts with another module
through a stable interface and does not need to be concerned with the other module's internal
implementation. With low coupling, a change in one module will not require a change in
the implementation of another module. Low coupling is often a sign of a well-structured
computer system, and when combined with high cohesion, supports the general goals of high
readability and maintainability.
Systems that do not exhibit low coupling might experience the following developmental
difficulties:
• Change in one module forces a ripple of changes in other modules.
• Modules are difficult to understand in isolation.
• Modules are difficult to reuse or test because dependent modules must be included.
The concept of coupling is usually related to the concept of cohesion: low coupling facilitates
high cohesion, and vice versa. For example, one approach to increasing cohesion is functional

Programming Logics & Techniques 115


115
3 | Program Techniques (Approaches)

design, which seeks to limit the responsibilities of modules along functionality, coupling
increases between two classes A and B if:
• A has an attribute that refers to (is of type) B.
• A calls on services of an object B.
• A has a method which references B (via return type or parameter).
• A is a subclass of (or implements) class B.
Low coupling may also reduce performance, and a highly-coupled system is sometimes
desirable to achieve maximum efficiency. Regardless, in many modern computing systems,
the cost of reduced performance is often seen as a worthy trade for the benefits to the software
development process that result from low coupling.

Types of Coupling
Some types of coupling, in the order of highest to lowest, are as follows:
Content Coupling (high)
Content coupling is when one module modifies or relies on the internal workings of another
module (e.g. accessing local data of another module). Therefore, changing the way, the second
module produces data (location, type, timing) will lead to changing the dependent module.

Common Coupling
Common coupling is when two modules share the same global data (e.g. a global variable).
Changing the shared resource implies changing all the modules using it.

External Coupling
External coupling occurs when two modules share an externally imposed data format,
communication protocol, or device interface.

Control Coupling
In this type of coupling, one module controls the flow of another and passes information
from one to another (e.g. passing a what-to-do flag).

Stamp Coupling (Data-structured coupling)


Stamp coupling is when modules share a composite data structure and use only a part of it,
possibly a different part (e.g. passing a whole record to a function which only needs one field
of it). This may lead to changing the way a module reads a record because a field, which the
module doesn't need, may have been modified.

Data Coupling
Data coupling is when modules share data through, for example, parameters. Each datum is
an elementary piece, and these are the only data which are shared (e.g. passing an integer to a
function which computes a square root).

61116
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Message Coupling (low)


This is the loosest type of coupling. Modules are not dependent on each other, instead they
use a public interface to exchange parameter-less messages (or events, see Message passing).

No Coupling
Modules do not communicate at all with one another.

Subclass Coupling
Describes the relationship between a class and its parent. The class is connected to its parent,
but the parent isn't connected to the child.

Temporal Coupling
When two actions are bundled together into one module just because they happen to occur at
the same time, high cohesion and low coupling are attributes of good design.

Module Coupling
Coupling in Software Engineering describes a version of metrics associated with this concept.
For data and control flow coupling:
di = number of input data parameters
ci = number of input control parameters
do = number of output data parameters
co = number of output control parameters

For global coupling:


gd = number of global variables used as data
gc = number of global variables used as control

For environmental coupling:


w = number of modules called (fan-out)
r = number of modules calling the module under consideration (fan-in)
Coupling (C) = 1 - 1/(di + 2·ci + do + 2·co + gd + 2·gc + w + r)
"1 - ..." makes the value larger the more coupled the module is. This number
ranges from approximately 0.66 (low coupling) to 1.0 (highly coupled)
For example, if a module has only a single input and output data parameter
C = 1 - 1/(1+0+1+0+0+0+1+0) = 1 - 1/3 = 0.67
If a module has 5 input and output data parameters, an equal number of control
parameters, and accesses 10 items of global data, with a fan-in of 3 and a fan-out of 4,
C = 1 - 1/(5 + 2·5 + 5 + 2·5 + 10 + 0 + 3 + 4) = 0.97
Known issues
Very loosely coupled systems have the added advantage that they tend to build more quickly.

Programming Logics & Techniques 117


117
3 | Program Techniques (Approaches)

This is due to the low amounts of inter-module dependency. Systems such as CORBA or
COM allow objects to communicate with each other without having to know anything about
the other's implementation. Both these systems even allow for objects to communicate with
objects written in other languages. The fact that the objects may be built independently reduces
the amount of recompilation required when changes are applied.

High Cohesion
Cohesion is a measure of how strongly-related or focused the responsibilities of a single
class are. In object-oriented programming, if the methods that serve the given class tend to be
similar in many aspects the class is said to have high cohesion. In a highly-cohesive system,
code readability and the likelihood of reuse is increased, while complexity is kept manageable.
Cohesion is decreased if:
The responsibilities (methods) of a class have little in common.
Methods carry out many varied activities, often using coarsely-grained or unrelated sets of
data.

Disadvantages of low cohesion (or "weak cohesion") are:


Increased difficulty in understanding modules.
Increased difficulty in maintaining a system, because logical changes in the domain affect
multiple modules, and because changes in one module require changes in related modules.
Increased difficulty in reusing a module because most applications won’t need the random set
of operations provided by a module.

Types of Cohesion
Cohesion is a qualitative measure meaning that the source code text to be measured is
examined using a rubric to determine a cohesion classification. The types of cohesion, in
order of the worst to the best type, are as follows:
Coincidental Cohesion (worst)
Coincidental cohesion is when parts of a module are grouped arbitrarily (at random); the parts
have no significant relationship (e.g. a module of frequently used functions).
Logical Cohesion
Logical cohesion is when parts of a module are grouped because they logically are categorised
to do the same thing, even if they are different by nature (e.g. grouping all I/O handling
routines).
Temporal Cohesion
Temporal cohesion is when parts of a module are grouped by when they are processed.
The parts are processed at a particular time in program execution (e.g. a function
which is called after catching an exception which closes open files, creates an error
log, and notifies the user).
81118
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Procedural Cohesion
Procedural cohesion is when parts of a module are grouped because they always follow a certain
sequence of execution (e.g. a function which checks file permissions and then opens the file).
Communicational Cohesion
Communicational cohesion is when parts of a module are grouped because they operate on
the same data (e.g. a module which operates on the same record of information).
Sequential Cohesion
Sequential cohesion is when parts of a module are grouped because the output from one part
is the input to another part like an assembly line (e.g. a function which reads data from a file
and processes the data).
Functional cohesion (best)
Functional cohesion is when parts of a module are grouped because they all contribute to a
single well-defined task of the module (e.g. parsing XML in the case of Expat (XML)).
Since cohesion is a ranking type of scale, the ranks do not indicate a steady progression
of improved cohesion. Studies by various people including Larry Constantine, Edward
Yourdon, and Steve McConnell indicate that the first two types of cohesion are inferior;
communicational and sequential cohesion are very good; and functional cohesion is superior.
While functional cohesion is considered the most desirable type of cohesion for a software
module, it may not be achievable. There are cases where communicational cohesion is the
highest level of cohesion that can be attained under the circumstances.

Communication between Modules


Two types of information are passed between modules:
Data
This is shown by an arrow with open circles at its tail. In the example shown below, the
module GET CUSTOMER DETAILS invokes the modules FIND CUSTOMER NAME by
passing the Customer Account Number, Fig below. The name of the data is written alongside
this data couple.
Control
Control items are used to direct program control and error or end of file conditions. In the
example shown below. The flag Account Number OK is sent to the calling module to confirm
that the requested account number does have a valid account name. This control couple is
shown by a filled-in circle on the tail of arrow.
In many practical instances it is physically impossible to show all the control couplings on
the structure chart. Consequently, it may the advisable to show couples only when there is no
other coupling between modules, i.e. No data coupling takes place.
Programming Logics & Techniques 119
119
3 | Program Techniques (Approaches)

GET Calling Module


CUSTOMER
DETAILS

Customer Account Number

Customer Name

Account Number is OK
FIND
CUSTOMER
NAME Called Module

Fig.: Communication between modules

02120
1 Programming Logics & Techniques
3 | Program Techniques (Approaches)

Questions
Solve the following questions. (each question carries 7/8 Marks)
1. List the types of program development models. Explain V-model & Big Bang
2. Differentiate between structured and object-oriented programming.
3. Define cohesion and coupling with its three types of techniques.
4. Explain Spiral Model of Program Development. Give an example using this model in an
organization.
5. Explain the top down programming technique with an example.
6. What are the Program Development Models? Which type of model do you suggest for
developing a project whose requirements are not clearly provided by the client? Provide
reasons to support your answer.
7. How can the communication between modules be done? Differentiate between cohesion
and coupling.
8. What is waterfall model? Compare waterfall model with spiral model and which one is
preferable to use and why?
9. Define the programming techniques? Explain modular techniques with advantages.
10. What is waterfall model? Compare waterfall model with spiral model and which model
do you prefer to use and why?

Write Short Notes on the following: (each question caries 5 marks)


a. Modular Programming l. Business Requirement Analysis
b. Top-down programming m. RAD Model
c. Bottom-Up programming n. Big Bang Model
d. Structured Programming o. Evaluation Model
e. Object Oriented Programing p. Cohesion and Coupling
f. Software Production Process q. Type of Cohesion
g. Waterfall Model r. Type of Coupling
h. Prototype Model s. Communication between modules
i. Spiral Model t. Functional and non-functional
j. Iterative Model Requirement
k. V-Model u. Design Specification

Programming Logics & Techniques 121


121
4 | Program Maintenance

Program Maintenance
Unit-4

Objectives
This unit has following objectives:
1) To make the students aware of program maintenance,
cost issues and time factors.
2) To gain the analytical knowledge to set up and ratio of
the budget for development and maintenance of the
programme.
3) To create importance of program documentation and its
standard.
4) To create the idea for program design with system flow
chart and DFD.
5) To lean the necessary requirement specification of the
program and development procedures.

22122
1 Programming Logics & Techniques
4 | Program Maintenance

Introduction
Program maintenance is the process of repairing program after its delivery to the customer
once the system passes the entire test. It can also be defined as the technique of updating,
alteration, or correction of an application.
Software maintenance in software engineering is the modification of a software product
after delivery to correct faults, to improve performance or other attributes, or to adapt the
product to a modified environment
In another sense, software maintenance is the totality of activities required to provide cost-
effective support to a software system. Activities are performed during the pre-delivery stage
as well as the post-delivery stage. Pre-delivery activities include planning for post-delivery
operation, supportability, and logistics determination. Post–delivery activities include
software modification, training, and operating a help desk.
This international standard describes the 6 software maintenance processes as:
i. The implementation processes, which contain software preparation and transition
activities, such as the conception and creation of the maintenance plan, the preparation
for handling problems identified during development, and the follow-up on product
configuration management.
ii. The problem and modification analysis process, which is executed once the application
has become the responsibility of the maintenance group. The maintenance programmer
must analyze each request, confirm it (by reproducing the situation) and check its validity,
investigate it and propose a solution, document the request and the solution proposal, and,
finally, obtain all the required authorizations to apply the modifications.
iii. The process considering the implementation of the modification itself.
iv. The process acceptance of the modification, by checking it with the individual who
submitted the request in order to make sure that the modification provided a solution.
v. The migration process (platform migration, for example) is exceptional, and is not part
of daily maintenance tasks. If the software must be ported to another platform without any
change in functionality, this process will be used and a maintenance project team is likely
to be assigned to this task.
vi. Finally, the last maintenance process, also an event which does not occur on a daily
basis, is the retirement of a piece of software.

Types/Components of Program/Software Maintenance


Software Maintenance is the last step in the Software Development Life Cycle that does not
get its fair share of attention. And we understand that, when people shed thousands of bucks
on software, they expect it to conform to their needs both at present and in the future. There are a
number of reasons, why modifications are required, some of them are briefly mentioned below:
Programming Logics & Techniques 123
123
4 | Program Maintenance

Market Conditions
Policies, which change over the time, such as taxation and newly introduced constraints like,
how to maintain book keeping, may trigger need for modification.
Client Requirements
Over the time, customer may ask for new features or functions in the software.
Host Modifications
If any of the hardware and/or platform (such as operating system) of the target host changes,
software changes are needed to keep adaptability.
Organizational Changes
If there is any business level change at client end, such as reduction of organization strength,
acquiring another company, organization venturing into new business, need to modify in the
original software may arise.
These basically can be categorized into five types of maintenance, namely, corrective,
adaptive, perfective, preventive and emergency.

Corrective Maintenance
It is concerned with fixing errors that are observed when the software is in use. It deals with the
repair of faults or defects found in day-to-day system functions. A defect can result due to errors
in software design, logic and coding. Design errors occur when changes made to the software
are incorrect, incomplete, wrongly communicated, or the change request is misunderstood.
Logical errors result from invalid tests and conclusions, incorrect implementation of design
specifications, faulty logic flow, or incomplete test of data. All these errors, referred to as
residual errors, prevent the software from conforming to its agreed specifications. Note that
the need for corrective maintenance is usually initiated by bug reports drawn by the users.
In the event of a system failure due to an error, actions are taken to restore the operation
of the software system. The approach in corrective maintenance is to locate the original
specifications in order to determine what the system was originally designed to do. However,
due to pressure from management, the maintenance team sometimes resorts to emergency
fixes known as patching.
Corrective maintenance accounts for 20% of all the maintenance activities.

Adaptive Maintenance
It is concerned with the change in the software that takes place to make the adapted software
to new environment such as to run the software on a new operating system. It makes the
adapting software change in the environment such as the hardware or the operating system.
The term environment in this context refers to the conditions and the influences which act
(from outside) on the system. For example, business rules, work patterns, and government
policies have a significant impact on the software system.

42124
1 Programming Logics & Techniques
4 | Program Maintenance

For instance, A bank decides to offer a new mortgage product. This will have to be included
in the system so that mortgage interest and payments can be calculated or the Government
recently changed the VAT rate from x% to y%. This change meant that many organizations
had to make alterations to their systems.
Adaptive maintenance accounts for 20% of all the maintenance activities.

Perfective Maintenance
It is concerned with implementing new or changed user requirements. It involves making
functional enhancements to the system in addition to the activities to increase the system’s
performance even when the changes have not been suggested by faults. This includes
enhancing both the function and efficiency of the code and changing the functionalities of the
system as per the users’ changing needs.
Examples of perfective maintenance include Re-organizing data sets within a database so they
can be searched faster or use less storage or providing shortcuts commands that experts can
use instead of the slower standard menu system.
Perfective maintenance accounts for 50%, that is, the largest of all the maintenance activities.

Preventive Maintenance
It involves performing activities to prevent the occurrence of errors. It tends to reduce
the software complexity thereby improving program understandability and increasing
software maintainability. It comprises documentation updating, code optimization, and
code restructuring. Documentation updating involves modifying the documents affected by
the changes in order to correspond to the present state of the system. Code optimization
involves modifying the programs for faster execution or efficient use of storage space. Code
restructuring involves transforming the program structure for reducing the complexity in
source code and making it easier to understand.
Preventive maintenance is limited to the maintenance in organization only and no external
requests are acquired for this type of maintenance.
Preventive maintenance accounts for only 5% of all the maintenance activities.

Emergency Maintenance
It is the unscheduled corrective maintenance performed to keep a system operational. In some
of the cases this maintenance is included in corrective maintenance.
Preventive maintenance accounts for only 5% of all the maintenance activities.
The above classification can include the idea that software maintenance can be either scheduled
or unscheduled and reactive or proactive.
Maintenance Unscheduled Scheduled
Reactive Emergency corrective and Adaptive maintenance
Proactive Perfective, Preventive maintenance

Programming Logics & Techniques 125


125
4 | Program Maintenance

Proactive Maintenance
Planned maintenance (PM), also often referred to as scheduled maintenance or planned
preventive maintenance (PPM) is a proactive strategy where maintenance and inspections on
assets (i.e. plant and equipment) are scheduled at regular intervals to ensure that an item of
equipment is operating correctly and to minimise breakdown and downtime levels.
Reactive Maintenance
On the other hand, reactive maintenance, also often referred to as breakdown maintenance
or corrective maintenance is very much a reactive strategy where repairs are performed at
the point when equipment fails. This is a far costlier approach for an organisation due to
unplanned production downtime, damaged machinery, overtime and callout fees and ideally
should only be performed on parts that are inexpensive and easy to replace.
Reactive maintenance focuses on repairing an asset once the failure occurs.
Proactive maintenance, however, focuses on avoiding repairs and asset failure through
preventive and predictive methods.
Proactive Maintenance vs. Reactive Maintenance
Advantages of Proactive Maintenance Advantages of Reactive Maintenance
Predict failure before they occur Minimal staff needed
Improves asset reliability Minimal preparation time
Saves time and money in the long run Less expensive in the short term

Problem Areas in Program Maintenance


The term “program maintenance” is commonly used to refer to the modifications that are
made to a program/system after its initial release. The maintenance is merely known as bug
fixing process. Program maintenance is not only done for error fixing and debugging but
also improving the performance and reducing the cost for software production. It is sure that
all programs require maintenance. The real use of maintenance in software production is to
maintain the program according to the requirement of the users need. Program maintenance
is comparatively less time consumed and cost taking process than developing a new program,
even though it has following three problems:
First, if the existing programmer is not available, then it is very difficult to trace and analyse
the problems for maintenance.
Secondly, Programs are complex and very big, so most programmers want to plan and design
their own solutions.
Thirdly, in most of the cases it is very costly and time consuming. The different kinds of
problems occur in the program.

Costs Issues in Software Maintenance and Impact of Software Errors


To develop a particular project or software, there should be a budget which is pre-allocated
before starting it. Similarly, proper allocation of budget is most essential part in software/
62126
1 Programming Logics & Techniques
4 | Program Maintenance

program development. The successful project is always led by two things; they are time factor
and cost effectiveness. The expenditures are hardware, software and skillful experienced
manpower sector where budget should have been properly allocated and distributed.
Similarly, the cost required for maintenance of software is another heading to the software
production field. From the several surveys, it is evidenced that maintenance cost exceeds 60%
of the total cost of software development. To analyse the factor that affects such cost it is
customary to divide software maintenance into three categories, which we have already done
in the previous heading.
Corrective, Adaptive and Perfective maintenance are the main components of software
maintenance. Benet P. Lientz and E. Burton Swanson (1980) by examining several surveys
over 487 companies, they found that the near about cost is distributed according to the
following percentage ratio.

[Perfective M: Corrective M: Adoptive M: Other M = 50%: 20%: 20%: 10%]


The cost analysis is also done by the time-line short-fall graphical representation, which is
shown below:
Time-lines graph is very important to analyse the total cost necessary to increase overall
budget of the software production. In the graph it is clear that the initial product delivered
at time t1 satisfies neither the initial requirement of time t0 nor the user requirement for time
t1. Between time t1 and t3 the product is maintained in order to get closure to the users need.
Eventually, it is seen that at time t3 the cost of maintenance is so high that software developers
decide to do a major re-design. So that, the new release is available at time t.
Cost per unit Time vs. Time
0.02
0.018
0.016
0.014
Cost per unit Time

0.012
0.01 Minimum
Cost of
0.008 Replacement
0.006 Preventive
Replacement
0.004 Costs
Corrective
0.002 Replacement
Costs
0
0 100 200 300 400 500 600 700 800 900 1000
Time, t
Fig. : Cost among software maintenance vs. time
Programming Logics & Techniques 127
127
4 | Program Maintenance

The breakdown of maintenance cost was described by Lientz and Swanson (1980) by
examining several surveys.
42% of costs were attributed to changes in user requirement.
17% of costs were attributed to changes in data format.
12% of costs were attributed to changes in emergency fixes.
9% of costs were attributed to changes in routine and debugging
6% of costs were attributed to changes in hardware changes.
5% of costs were attributed to improvement in documentation.
4% of costs were attributed to improvement in efficiency.
5% of costs were attributed to other.

Program Documentation and its Standard


Program documentation is the process of storing, collecting, organizing as well as managing
all the historical records of the program/system or other documents used or prepared during
the different phases of the SDLC either on hardcopy or on softcopy. In common sense we
can also say that proper documentation is a better modeling of a document. The study about
IT and computer related subject can't be considered to be complete. until completion of
standard documentation. The documentation process also continues till its implementation
and operation period. Moreover, documentation is a process that never ends throughout the
life of the program or system.
Importance or Need for Documentation
Proper documentation of software is necessary due to the following reasons:
i) Problem Solving
Good documentation provides the better knowledge about the system repairing and
modification. In a large organization, the same person (computer designer) couldn't continue
his/her work throughout his/her life. So, documentation provides the way of justification
to the new designer which makes very easy to find out the problems or limitations in the
program.
ii) Easy to Understand
The proper documentation in the program is very essential which gives overall idea about
the program. So, a new designer or programmer also can very easily understand the whole
environment of the program, which makes easier to find out problems or errors in the
system. System flowcharts, program flowcharts, or comments used within the programs
prove to be very helpful in this regard.
iii) Economical and Time Saving
If a program is properly documented, the restating of the program in furnished format
will not be very costly because documented records are quite helpful for that purpose.
Collection of data or records, understanding of logic as well as of the whole system is
time consuming process, which can be eliminated if program is properly documented. So
overall cost and time of the re-design system will be reduced.
82128
1 Programming Logics & Techniques
4 | Program Maintenance

iv) Helps for Evaluation Process


Documentation can provide controls not only internal to the firm, but also external to the
business application such as audit trails which will be the reference for system evaluation.
v) Quality Control
Proper documentation provides the overall activities of the software/system development
phases and operation which is used to check the quality of it at regular intervals throughout
its production. Documentation is part of the "exit criteria" (Final output) from each stage
of the production process; as such its quality reflects the quality of the specification,
design and code produced.

Forms/Requirements of Documentation (Good Documentation)


The documentation of the program can be specified either in computer program itself or in
external sources (paper, storing, devices etc.) Good documentation starts with the statement
of the problem. Why the program was created! It tells what the program can do. It also tells
how it is done. Hence good documentation implies that each aspect of the documentation is
generously sprinkled with concise comments that explain the design, objectives, algorithms,
procedures and other requirement of the program. The three commonly used forms of
documentation for documenting software are:
• Comments
• System Manuals
• Operation/User Manuals
1) Comments
Comments are very useful aid in documenting a program. Providing comments in the
program is one of the good or standard sign of documentation. From maintenance point
of view, comments have been considered to be must. The comments provide ideas about
the program specification. They are used to explain the logic of the program. Comments
should be used intelligently to improve the quality and understandability of the program.
They should be written in very accurate, meaningful, and readable form. After the program
coding the comments are included. For example, in c programming /* program to add
given two numbers A and B */ is a comment.

2) System Manual
It is the manual provided by the system designer containing detailed information about
the program. A good documentation or system manual should contain the following
information:
• The syntax and statement of the problem clearly defining the objective of the program
and its importance to the user.
• The detailed information about the program like program function, system limitation,
problem areas; environment of program etc. should be included.

Programming Logics & Techniques 129


129
4 | Program Maintenance

The purpose and its description.


• Detailed system flowchart and program flowchart.
• Narration and listing of programs.
• Modification of listing ideas.
• Total description about input and output media to operate the program.
• Specimen of all input forms and printed output.
• Output and input/output file records (file layout)
• The total description of testing, validating and maintenance process.

3) Operation Manual / User Manual


A good software package must be supported with a good user manual to ensure the smooth
running of the package. It is the user who will perform the regular processing after the
software is released and not the programmer who has developed the package. This is the
manual, which provides the description about operation system of a program. Hence the
operation manual must contain the following information.
• Set up and operational details of the program.
• List of Computer switches, their locations setting and purpose.
• Loading and unloading procedures.
• Starting, running and terminating processes.
• A description of any control system or statements.
• All console commands along with errors and console messages that could arise, their
meaning, reply and / or operation action.
• List of programs to be executed before and after execution of each program.

Types of documentation
Based on the application the documentation can be categorized into following types:
• Design Documentation
• Program Documentation
• Training Documentation
• Operations Documentation
• User Reference documentation
Design Documentation
It describes the overall system design and includes system flowcharts, all input/output formats,
file description, control requirements and report specifications.
Program Documentation
It consists of programming specification like program logic, graphic aids, input-output formats etc.
Training Documentation
It includes user training manuals and materials to be used in the conversion and the installa-
tion of system.

03130
1 Programming Logics & Techniques
4 | Program Maintenance

Operations Documentation
It contains instructions for normal operations as well as directions for handling problems and
break-down of the system.
User Reference Documentation
It is used after training is over and the system is installed. It should provide quick, clear
answers like a dictionary.

Program Specification
Program specification is defined as the detail of the documentation which contains a precise
statement of the requirements of the program. In general, we can view a specification as the
statement of an agreement between a producer and a consumer of the service or between an
implementer and a user.
The contents of the program specification are shown below:
• The inputs of the program
• The outputs of the program
• The major program functions
• The different types of the program interface before and after implementation
• The parameter of the programs
• The validation requirements for the layout of output data printout and screens.
• The action to be taken on errors and exceptions
• Any special requirements for table’s formulae or algorithm.

The specification may also contain a more detailed description of the logical rules and
decisions. The program must involve, and more details about how the input should be checked,
altered and used.
To define the program specification various kind of the system design tools are used. The
important tools are algorithm, flowchart, decision table, pseudocode, program flow chart,
system flow chart, dataflow diagram and entity relation diagram. Out of them two tools are
explaining here.

System Flow Charts


Flowcharts describe in detail how a process will be carried out, but during the development
of an information system it is useful to be able to produce a more general description of how
a system will work.
A system flowchart is a physical design tool that shows in general terms the operations that
will be performed on information in an information system.
The arrows on a system flowchart show the direction that data will flow in around the system
rather than the order in which the operations will be carried out.

Programming Logics & Techniques 131


131
4 | Program Maintenance

Many more are used on a system flowchart than on a normal flowchart. These are the symbols
that may be used:

Input
Tape Manual Input
Process Process
Storage e.g. Keyboard
Output

Manual Printed Output on


Operation Output Disk Storage
Screen

Fig.: Symbols of system flow-chart

Example:
A car repair garage uses a computer system to produce invoices and keep track of the parts it
has in stock. The system uses two files:
• Stock File: Contains details of all parts that are in stock.
• Orders File: Contains details of all parts that are on order.
When a repair is completed the mechanic records the parts that were used in a form. These
parts are then entered into the computer by an operator. The list of parts that is entered is
checked against the stock list to reduce the likelihood of the operator making a mistake. If the
operator enters the name of a part that does not exist then an error report is displayed. When
the parts list has been entered the cost of the parts is looked up in the stock file and an invoice
(bill) is printed for the customer.
Every night the computer system checks the stock file. A report is printed to indicate which
parts need to be ordered from the garage's suppliers. Details of any orders are placed in the
orders file.
When a delivery of new parts is made to the garage the person making the delivery gives the
garage a delivery note. The delivery note contains a list of the parts that have been delivered.
The list of new parts is entered into the computer by an operator. If any parts have been
delivered that were not ordered then an error report is printed. When an order is delivered the
information about the order is removed from the orders file and the stock file is updated.
The structure of this system can be shown in figure using the following system flowchart:
Note that system flowcharts are distinctly different from program flowcharts, which are used
to represent the logic in an algorithm. They do not use a start or end symbol, and are not
intended to represent complex logic.

23132
1 Programming Logics & Techniques
4 | Program Maintenance

Mechanic Invoice printed


records parts for customer
used.

Validate parts
Parts list entered list against stock Error report
by operator database showing
invalid parts

Delivery note Stock file Orders to send


showing parts to suppliers
delivered

Check parts were Reorder low


Delivery details stock.
entered by operator on order, then add
to stock file.

Error report
showing Orders file
parts not wanted

Fig. : System flow-chart


The following system flowchart represents parts of the current system used by a local doctor
in managing their patient information.

Patient
details
Add a new
patient

Patient Patient file


confirmation

Visit
details Consultation

Consultation file

Billing
Medicare
Patient system
account
Fig. System flow-chart
Programming Logics & Techniques 133
133
4 | Program Maintenance

Data Flow Diagram


Introduction
A data flow diagram is a graphical documentation of a system. One of the tools of system
structure analysis is the data flow diagram. In simple sense data flow diagram is the graphical
representation of flow of data in the system design. The data flow diagram is important for
following two purposes.
a) Provide a graphic tool, which can be used by the analyst to explain his understanding of the
system to the user. It is easily converted into a structure chart, which is used in system design.
b) The system analyst should understand the details about the project before the use of data
flow diagram. The process of good documentation is also the impact of data flow diagram.
The 1st step in documentation of a system would be the context analyst diagram. In a
context analyst diagram, the whole system is represented by a single circle. In a data flow
diagram, the system is shown in more details.
A data flow diagram (DFD) is a graphical representation of the "flow" of data through an
information system. It differs from the flowchart as it shows the data flow instead of the
control flow of the program.
What is a data flow diagram?
A data flow diagram (DFD) maps out the flow of information for any process or system. It
uses defined symbols like rectangles, circles and arrows, plus short text labels, to show data
inputs, outputs, storage points and the routes between each destination. Data flowcharts can
range from simple, even hand-drawn process overviews, to in-depth, multi-level DFDs that
dig progressively deeper into how the data is handled. They can be used to analyze an existing
system or model a new one. Like all the best diagrams and charts, a DFD can often visually
“say” things that would be hard to explain in words, and they work for both technical and
nontechnical audiences, from developer to CEO. That’s why DFDs remain so popular even
after all these years. While they work well for data flow software and systems, they are less
applicable nowadays to visualizing interactive, real-time or database-oriented software or systems.

Fig.: DFD
43134
1 Programming Logics & Techniques
4 | Program Maintenance

History of the DFD


Data flow diagrams were popularized in the late 1970s, arising from the book Structured
Design, by computing pioneers Ed Yourdon and Larry Constantine. They based it on the
“data flow graph” computation models by David Martin and Gerald Estrin. The structured
design concept took off in the software engineering field, and the DFD method took off with
it. It became more popular in business circles, as it was applied to business analysis, than in
academic circles.
Also contributing were two related concepts:
• Object Oriented Analysis and Design (OOAD), put forth by Yourdon and Peter Coad to
analyze and design an application or a system.
• Structured Systems Analysis and Design Method (SSADM), a waterfall method to analyze
and design information systems. This rigorous documentation approach contrasts with
modern agile approaches such as Scrum and Dynamic Systems Development Method
(DSDM.)
Three other experts contributing to this rise in DFD methodology were Tom DeMarco, Chris
Gane and Trish Sarson. They teamed up in different combinations to be the main definers of
the symbols and notations used for a data flow diagram.

Symbols/Elements and Notations Used in DFDs


Two common systems of symbols are named after their creators:
• Yourdon-Coad and Yourdon -DeMarco
• Gane and Sarson
One main difference in their symbols is that Yourdon-Coad and Yourdon-DeMarco use circles
for processes, while Gane and Sarson use rectangles with rounded corners, sometimes called
lozenges. There are other symbol variations in use as well, so the important thing to keep in
mind is to be clear and consistent in the shapes and notations you use to communicate and
collaborate with others.
Using any convention’s DFD rules or guidelines, the symbols depict the four components of
data flow diagrams.
External entity: It is an outside system that sends or receives data, communicating with the
system being diagrammed. They are the sources and destinations of information entering or
leaving the system. They might be an outside organization or person, a computer system or
a business system. They are also known as terminators, sources and sinks or actors. They are
typically drawn on the edges of the diagram.
Process: It is any process that changes the data, producing an output. It might perform
computations, or sort data based on logic, or direct the data flow based on business rules. A
short label is used to describe the process, such as “Submit payment.”
Data store: files or repositories that hold information for later use, such as a database table or
a membership form. Each data store receives a simple label, such as “Orders.”
Programming Logics & Techniques 135
135
4 | Program Maintenance

Data flow: It is the route that data takes between the external entities, processes and data
stores. It portrays the interface between the other components and is shown with arrows,
typically labeled with a short data name, like “Billing details.”

Data flow diagram symbols and notation


Depending on the methodology (Gane and Sarson vs. Yourdon and Coad), DFD symbols
vary slightly. However, the basic ideas remain the same. There are four basic elements of a
data flow diagram: processes, data stores, external entities, and data flows. The picture below
shows the standard shapes for both methodologies.

Gane and Sarson Yourdon and Coad

1.0
1.0
Process
Process

Data Store Data Store

External External
Entity Entity

Data Flow Data Flow

Fig.: Symbols of DFD

63136
1 Programming Logics & Techniques
4 | Program Maintenance

DFD rules and tips


• Each process should have at least one input and an output.
• Each data store should have at least one data flow in and one data flow out.
• Data stored in a system must go through a process.
• All processes in a DFD go to another process or a data store.

DFD levels and layers: From context diagrams to pseudocode


It is a common practice to draw a context-level Data flow diagram first which shows the
interaction between the system and outside entities. The DFD is designed to show how a
system is divided into smaller portions and to highlight the flow of data between those parts.
This context-level Data flow diagram is then "exploded" to show more detail of the system
being modeled.
A data flow diagram can dive into progressively more details by using levels and layers,
zeroing in on a particular piece. DFD levels are numbered 0, 1 or 2, and occasionally go to
even Level 3 or beyond. The necessary level of detail depends on the scope of what you are
trying to accomplish.
DFD Level 0 is also called a Context Diagram. It’s a basic overview of the whole system
or process being analyzed or modeled. It’s designed to be an at-a-glance view, showing the
system as a single high-level process, with its relationship to external entities. It should be
easily understood by a wide audience, including stakeholders, business analysts, data analysts
and developers.

Fill cancellation form Up/down hotel info

Fill reservation form Hotel Resva/cancel info


Guest Admin
Reservation
Room info Guest info
waiting info

Fig.: Context diagram

DFD Level 1 provides a more detailed breakout of pieces of the Context Level Diagram. You
will highlight the main functions carried out by the system, as you break down the high-level
process of the Context Diagram into its sub processes.

Programming Logics & Techniques 137


137
4 | Program Maintenance

Reservation
storage file
Room
selection
Process
Reservation
Guest
Process

Report to
admin

Enquiry

Down storage Up storage

Fig.: DFD level 1


DFD Level 2 then goes one step deeper into parts of Level 1. It may require more text to reach
the necessary level of detail about the system’s functioning.
Reservation
Reservation Report
Reservation

Query Confirmation
Process Process
Searching
Guest

Waiting
Reservation Process
Inquiry Process

Waiting

Room selection
Cancellation Process
Hotel
Process
Reservation

Waiting table Cancel table


Fig.: DFD level 2
83138
1 Programming Logics & Techniques
4 | Program Maintenance

​ rogression to Levels 3, 4 and beyond is possible, but going beyond Level 3 is uncommon.
P
Doing so can create complexity that makes it difficult to communicate, compare or model
effectively.
Using DFD layers, the cascading levels can be nested directly in the diagram, providing a
cleaner look with easy access to the deeper dive.
By becoming sufficiently detailed in the DFD, developers and designers can use it to write
pseudocode, which is a combination of English and the coding language. Pseudocode
facilitates the development of the actual code.

How to create a data flow diagram


Now that you have some background knowledge on data flow diagrams and how they are
categorized, you’re ready to build your own DFD. The process can be broken down into 5
steps:
1. Identify major inputs and outputs in your system
Nearly every process or system begins with input from an external entity and ends with the
output of data to another entity or database. Identifying such inputs and outputs gives a macro
view of your system, it shows the broadest tasks the system should achieve. The rest of your
DFD will be built on these elements, so it is crucial to know them early on.

2. Build a context diagram


Once you’ve identified the major inputs and outputs, building a context diagram is simple.
Draw a single process node and connect it to related external entities. This node represents the
most general process information which undergoes to go from input to output.
The example below shows how information flows between various entities via an online
community. Data flows to and fro from the external entities, representing both input and
output. The center node, “online community,” is the general process.

3. Expand the context diagram into a level 1 DFD


The single process node of your context diagram doesn’t provide much information, you need to
break it down into sub processes. In your level 1 data flow diagram, you should include several
process nodes, major databases, and all external entities. Walk through the flow of information:
where does the information start and what needs to happen to it before each data store?

4. Expand to a level 2+ DFD


To enhance the detail of your data flow diagram, follow the same process as in step 3. The
processes in your level 1 DFD can be broken down into more specific sub processes. Once
again, ensure that you add any necessary data stores and flows at this point you should have
a fairly detailed breakdown of your system. To progress beyond a level 2 data flow diagram,
simply repeat this process. Stop once you’ve reached a satisfactory level of detail.

Programming Logics & Techniques 139


139
4 | Program Maintenance

5. Confirm the accuracy of your final diagram


When your diagram is completely drawn, walk through it. Pay close attention to the flow
of information: Does it make sense? Are all necessary data stores included? By looking at
your final diagram, other parties should be able to understand the way your system functions.
Before presenting your final diagram, check with co-workers to ensure your diagram is
comprehensible.
Examples of how DFDs can be used
Data flow diagrams are well suited for analysis or modeling of various types of systems in
different fields.
DFD in software engineering: This is where data flow diagrams got their main start in
the 1970s. DFDs can provide a focused approach to technical development, in which more
research is done up front to get to coding.
DFD in business analysis: Business analysts use DFDs to analyze existing systems and find
inefficiencies. Diagramming the process can uncover steps that might otherwise be missed or
not fully understood.
DFD in business process re-engineering:  DFDs can be used to model a better, more efficient
flow of data through a business process. BPR was pioneered in the 1990s to help organizations
cut operational costs, improve customer service and better compete in the market.
DFD in agile development: DFDs can be used to visualize and understand business and
technical requirements and plan the next steps. They can be a simple yet powerful tool for
communication and collaboration to focus rapid development.
DFD in system structures: Any system or process can be analyzed in progressive detail to
improve it, on both a technical and non-technical basis.

DFD vs. Unified Modeling Language (UML)


While a DFD illustrates how data flows through a system, UML is a modeling language used
in Object Oriented Software Design to provide a more detailed view. A DFD may still provide
a good starting point, but when actually developing the system, developers may turn to UML
diagrams such as class diagrams and structure diagrams to achieve the required specificity.

Logical DFD vs. Physical DFD


These are the two categories of a data flow diagram. A Logical DFD visualizes the data flow
that is essential for a business to operate. It focuses on the business and the information needed,
not on how the system works or is proposed to work. However, a Physical DFD shows how
the system is actually implemented now, or how it will be. For example, in a Logical DFD,
the processes would be business activities, while in a Physical DFD, the processes would be
programs and manual procedures.

04140
1 Programming Logics & Techniques
4 | Program Maintenance

Top-Down Approach
The system designer makes "a context level DFD" or Level 0, which shows the "interaction"
(data flows) between "the system" (represented by one process) and "the system environment"
(represented by terminators).
The system is "decomposed in lower level DFD (Level 1)" into a set of "processes, data
stores, and the data flows between these processes and data stores".
Each process is then decomposed into an "even lower level diagram containing its sub-
processes".
This approach "then continues on the subsequent sub-processes", until a necessary and
sufficient level of detail is reached which is called the primitive process.
DFD is also a virtually designable diagram that technically or diagrammatically describes the
inflow and outflow of data or information that is provided by the external entity.

Event Partitioning Approach


Event partitioning was described by Edward Yourdon in Just Enough Structured Analysis.
a) Construct detailed Data flow diagram.
b) The list of all events is made.
c) For each event a process is constructed.
d) Each process is linked (with incoming data flows) directly with other processes or via
data stores, so that it has enough information to respond to a given event.
e) The reaction of each process to a given event is modeled by an outgoing data flow.

In order to understand the concept of data flow diagram, let us consider the following example
of a bank.
People depositing the amount in their respective account in the bank can withdraw amount
whenever they required according to the rules and regulations of bank. Any person or
organization can deposit or withdraw money based on their need. To deposit money in the
bank, one has to fill in the voucher and deposit in his account by the account officer of bank.
The above action can be analyzed by the following context analysis diagram.
Context analysis diagram.

Account Process Account Holder File


Holder

Fig.: Context diagram

Programming Logics & Techniques 141


141
4 | Program Maintenance

As we know that by above diagram the whole system is represented by a single circle in the
context analysis diagram.
This task is represented by data flow diagram, which is given below.

Amount withdraw
acknowledgment
1 2
Cheque Verification Verified Verification
Account Verified
Issue of Cheque Issue of Amount Record
Holder

1 Account Holder File

Feedback
Fig. Physical DFD of banking system

Drawing Data Flow Diagram


To draw the data flow diagram the system analyst has to concentrate his brain on the following
listed points.
• Fix the scope of the system and identify all external entities.
• Identify all inputs and outputs to the systems.
• Fill in the data flow diagram body.
• Label all data flows.
• Label the process in terms of their inputs and outputs.
• Omit trivial error handing details.
• Do not show flow of control or control information or show data flow correctly.
1. Fix the scope of the system and identify all external entities
To draw the data flow diagram, first of all scope of the system should be fixed. Entities
where data originates from or flows to and are outside the scope of the system would be
classified as external entities. The scope of the system is fixed when the context analysis
diagram is drawn. Context analysis diagram fixes the scope, which gives external entities.
2. Identify all inputs and outputs to the system
Once the scope of the system is cleared and all external entities identified, identify
data flows to and from these external entities. These would be the inputs, outputs to the
system under study. During analysis, based on new facts discovered the context analysis
diagram would give all external entities inputs and outputs to the system.
3. Fill in the data flow diagram body
Once input and output have been identified the next step is to identify different processes
which convert or transform the inputs to the outputs. Examine the data flows, add or
process wherever data transformation is taking place. Leave the process unnamed for
the time being.
24142
1 Programming Logics & Techniques
4 | Program Maintenance

Enter data store to represent the various data repoints that are found in the system.
4. Label all data flows
Labeling is the process of naming the data flow elements as well as data flow itself. The
labeling to the data flow will have strong effect on following two points
• The readability of the data flow diagram.
• The accuracy of documentation.
The name of the data flow should accurately convey what the data flow is carrying.
Names are chosen to represent not only the data which is flowing, but also what is known
about the data.
Some more guidelines on labeling data flows are as follows:
• Entry of every data flow should be named.
• The name has to apply to the whole data flow and not just to its major elements or
components.
• No two data flows can have the same name.
• Names like "Data" and "Information" should be avoided.
5. Label the process in terms of their inputs and outputs.
The name of the process should accurately convey what is going on in the process, with
respect to data the process receives and sends out. Process name should normally be of
the form (strong verb) or single direct object. For example, in banking system to verify
the cheque the label process name like "verify balance".
Make sure the name of the process accurately conveys everything the process is doing.
Avoid words like "process" and "Handle". All the data, which is flowing into a process,
must be reflected in the output of the process. A process can't generate data on its own. It
only conveys some inputs to output.
1. Omit trivial error handling details: -
A data flow diagram would help the reader in getting the big picture work-out. Once the
broad overview of the system has been obtained, trivial error handling can be done later on.
Error can be considered trivial if they are:
• Not important financially.
• Probability of occurrence inflow is low.
• Irrelevant to the user.
When payment details are being verified invalid payment needn't be documented for the
time being. This doesn't mean that such error conditions are totally ignored. Methods to
take care of them will be discussed later on.
2. Don't show flow of control/Show data flow correctly.
Data flow diagram is a diagram of flow of data in the system. Therefore, it doesn't control
the system. If an information in a data flow is used only to start a process and isn't being
modified by the process, it is called control flow.
Programming Logics & Techniques 143
143
4 | Program Maintenance

Questions
Solve the following questions. (each question carries 7/8 Marks)
1. Write the importance of DFD. Draw the DFD to enroll in BCA first semester program
under Pokhara University.
2. Describe Data Flow Diagram with a suitable example.
3. What is program documentation? In what condition this documentation is more applicable.
4. Define program maintenance in program development. What is the role of budget
allocation while developing a good program?
5. Define program maintenance. What are the problematic areas in program maintenance?
6. What do you mean by DFD? Differentiate between DFD and Flowchart?
7. What is program maintenance? What are the impact of poor software maintenance budget
while system development planning?
8. What is program maintenance? Describe briefly the three types of program maintenance
methods with suitable examples
9. Explain the importance of documentation in program development. If proper documentation
is not done then what would happen?
10. Explain Data flow diagram with its elements. Draw a neat DFD for College Student
Registration System

Write Short notes on the following: (each question carries 5 marks)


a. Software Maintenance
b. Problem Area in Program Maintenance
c. Corrective and Adoptive Maintenance
d. Perfective and Preventive Maintenance
e. Proactive and Reactive Maintenance
f. Program Documentation and Standard
g. Importance or Need for Documentation
h. Good Documentation
i. Types of Documentation
j. Program Specification
k. Symbols of System Flow Chart
l. Flow Chart and DFD
m. Elements of DFD
n. Drawing Data Flow Diagram

44144
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Standalone and Client Server


Programming Concept Unit-5

Objectives

This unit has following objectives:


1. To make the students aware of computer and
communication, stand-alone and client server computing,
two and three-tier architecture of client server system,
we-based programing concept.
2. To identify the relationship of programming with client
server programming.
3. To crate the relationship between client server and web-
based programing.
4. To get various concepts about connection and its types.
5. To understand the use of platform independent feature of
software.

Programming Logics & Techniques 145


145
5 | Standalone and Client Server Programming Concept

Computer and Communication


The sending and receiving of information takes place in between two or more than two
objects just to make certain task is called communication. For example, the transmission
of data from one computer to another, or from one device to another. A communication
device, therefore, is any machine that assists data transmission. For example, modems/routers,
cables, and ports are all communication devices. Out of them computer is the most efficient
device. Communication software refers to programs that make it possible to transmit data.
Hence computer and communication form interrelated terminology for data management.
Computers and Communication networks are key infrastructures of the information
society with high socio-economic value as they contribute to the correct operations of many
critical services (from healthcare to finance and transportation). Internet is the core of
today's computer-communication infrastructures. This has transformed the Internet, from a
robust network for data transfer between computers, to a global, content-rich, communication
and information system where contents are increasingly generated by the users, and distributed
according to human social relations. Next-generation network technologies, architectures and
protocols are therefore required to overcome the limitations of the legacy internet and add
new capabilities and services. The future Internet should be ubiquitous, secure, resilient, and
closer to human communication paradigms.
Computer Communications is a peer-reviewed international journal that publishes high-quality
scientific articles (both theory and practice) and survey papers covering all aspects of future
computer communication networks (on all layers, except the physical layer), with a special
attention to the evolution of the Internet architecture, protocols, services, and applications.
Topics include, but are not limited to:
• Emerging technologies for next generation network
• LAN/WAN/MAN
• Future Internet architecture, protocols and services
• Content- and service-centric architecture
• Mobile and ubiquitous networks
• Self-organizing/autonomic networking
• Green networking
• Internet content search
• QoS (quality of services) and multimedia networking
• Opportunistic networking
• On-line social networks
• Internet of things
• Public safety communication networks
• Network applications (web, multimedia streaming, VoIP, gaming, etc.)
• Trust, security and privacy in computer and communication networks
• Modeling, measurement and simulation

64146
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

• Complex network models


• Internet socio-economic models
• Experimental test-beds and research platforms
• Algorithmic aspects of communication networks
• Network scaling and limits
As the technology improved in data communication, the computer network technology
becomes one of the important technologies among all. This is known as networking. The area
covered by a network can range from a small area to several continents.
There are mainly two types of computer system. They are :
1. Stand-alone system 2. Client-server System.

Stand-alone System (SAS)


It is the system where the processing system is centralized. Only one computer system is
sufficient to control the overall activities of a computer. In the SAS, the hardware, software
and data are in the same place. The data may be obtained from many sources but it is processed
only at the control location. Normally, there is no direct command between SAS and any other
computer system. Many personal and small business computers are stand-alone system.
Definition: A system that is completely operational without requiring external support is called SAS.
It refers to a device that is self-contained, one that does not require any other devices to
function. For example, a fax machine is a stand-alone device because it does not require
a computer, printer, modem, or other device. A printer, on the other hand, is not a stand-alone
device because it requires a computer to feed it data.

Standalone Programming Concept


In early computers, standalone program was a computer program designed to run on a
computer without an operating system. Standalone programs had to be loaded by the same
booting procedure that is also used to load an operating system.
A stand-alone program is a computer program that does not load any external module,
library function or program and that is designed to boot with the bootstrap procedure of
the target processor. It runs on bare metal. In early computers like the ENIAC without the
concept of an operating system, standalone programs were the only way to run a computer.
Standalone programs are usually written in or complied to the assembly language for the
specific hardware.
Later standalone programs typically were provided for utility functions such as disk formatting.
Also, computers with very limited storage used standalone programs, i.e. most computers
until the mid-1950s, and later still embedded processors.
Nowadays, standalone programs are a nearly extinct species of programs. Even the most basic
processors these days have sufficient storage to allow the operating system overhead, and if

Programming Logics & Techniques 147


147
5 | Standalone and Client Server Programming Concept

this is still a problem, basic general-purpose operating systems are available for that purpose.
E.g. in the diskette era, apparently standalone utility programs were delivered with a basic
version of DOS fitting onto the same diskette.
A stand-alone operating system is a complete operating system that works on a desktop
or notebook computer. A network operating system (also called network OS or NOS) is an
operating system that supports a network. A network is a collection of computers and devices
connected together via communications media and devices such as cables, telephone lines,
and modems. In some networks, the server is the computer that controls access to the hardware
and software on a network and provides a centralized storage area. The other computers on
the network, called clients, rely on the server(s) for resources.
Now, if we use the above definition, most, if not all, OS's are NOS (which OS's do "not"
support Networks?). If we evolve the definition a bit to refer to ones used as Heavy-Duty
Servers then perhaps a clear distinction would be between Windows XP and Windows Servers
(NT, 2000 etc.). Now if we change the meaning of NOS to mean the OS's that "routers" and
"switches" etc. use to manage networks, then we're speaking about embedded systems.
Linux for example can be considered both as stand-alone and network OS (many use it for
desktop/laptop computers with no servers and a lot of GUI programs as an example while
others strip it down and use it as a main server). It has mobile operating systems (Android for
one) built dependent on its kernel and there are another Embedded OS's that are built over its
kernel.
If by "the norm" you mean to ask about what most people use in their daily lives, then
perhaps with the original definition, yes, but you need to take into account that a lot of layers/
limitations are being removed due to the rising powers of embedded systems/devices and the
ubiquitous nature of the Internet.

Limitations of Stand-alone Programming


1. The sharing of data or information on computer to computer is not possible.
2. Software production and maintenance cost is comparatively very high.
3. The stand-alone machine is not responsible for controlling the user interface. They are displaying
information, validating input and providing meaningful feedback from the computer.
4. Programming ability and efficiency as compared to groups of computers to single
computers are different.
5. It has high speed as compared to client server programming system but in-group in the
case of client server flexibility efficiency, time sharing speed is high.

Client Server Programming/Computing


Unlike in a stand-alone programming system, in a client server programming system, the
server computer is responsible to control all the necessary client computers for any type of
computing system. Similarly, in a client server programming, one program is shared with

84148
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

more than one computers which are designed as a client machines. Such type of programming
is known as client server programming or computing.
In network architecture each computer or process on the network is either a client or a server.
Servers are powerful computers or processes dedicated to managing disk drives (file servers),
printers (print servers), or network traffic (network servers ). Clients are PCs or workstations
on which users run applications. Clients rely on servers for resources, such as files, devices,
and even processing power.
Another type of network architecture is known as a peer-to-peer architecture because each
node has equivalent responsibilities. Both client/server and peer-to-peer architectures are
widely used, and each has unique advantages and disadvantages.
Client-server architectures are sometimes called two-tier architectures.
Client/server describes the relationship between two computer programs in which one program,
the client, makes a service request from another program, the server, which fulfills the request.
Although the client/server idea can be used by programs within a single computer, it is a more
important idea in a network. In a network, the client/server model provides a convenient way
to interconnect programs that are distributed efficiently across different locations. Computer
transactions using the client/server model are very common. For example, to check your bank
account from your computer, a client program in your computer forwards your request to a
server program at the bank. That program may in turn forward the request to its own client
program that sends a request to a database server at another bank computer to retrieve your
account balance. The balance is returned back to the bank data client, which in turn serves it
back to the client in your personal computer, which displays the information for you.
The client/server model has become one of the central ideas of network computing. Most
business applications being written today use the client/server model. So, does the Internet's
main program, TCP/IP. In marketing, the term has been used to distinguish distributed
computing by smaller dispersed computers from the "monolithic" centralized computing
of mainframe computers. But this distinction has largely disappeared as mainframes and
their applications have also turned to the client/server model and become part of network
computing.
In the usual client/server model, one server, sometimes called a daemon, is activated and
awaits client requests. Typically, multiple client programs share the services of a common
server program. Both client programs and server programs are often part of a larger program
or application. Relative to the Internet, your Web browser is a client program that requests
services (the sending of Web pages or files) from a Web server (which technically is called
a Hypertext Transport Protocol or HTTP server) in another computer somewhere on the
Internet. Similarly, your computer with TCP/IP installed allows you to make client requests
for files from File Transfer Protocol (FTP) servers in other computers on the Internet.
Other program relationship models include master/slave, with one program being in charge of all
other programs, and peer-to-peer, with either of two programs able to initiate a transaction.

Programming Logics & Techniques 149


149
5 | Standalone and Client Server Programming Concept

In the basic model of client server architecture, a relational database management system
(RDBMS) resides on the server machine. The application program that resides on the client
machine interface with another software layer called middleware that is responsible for
communicating request and their result between the application program and the RDBMS.

The client-server architecture is a way of building computer systems. It consists in splitting


the system into two categories of programs: clients and servers.
A client is a program or a process which connects to another program (the server) and lets it
carry out a specific task. In particular it might require receiving some data from the server.
A server is a program or a process which provides services for clients. For example, it
might supply some data or a result of processing data to clients.
A communication (between a server and a client) requires establishing specific rules (a
language in which programs talk to each other). These rules are defined by the protocols.
A protocol is a language of communication among programs; in particular between a client
and a server.
Sockets
A fundamental notion for exchanging information through the network is a socket.
A socket is one end-point of a two-way communication link between two programs running
on the network
Usually, communication using sockets is based on the TCP or the UDP protocol.
TCP (Transmission Control Protocol) is a connection-based protocol that provides a
reliable flow of data between two computers. It guarantees that the sent data are not lost
and arrived in the proper order to the receiver.
UDP (User Datagram Protocol) is a protocol that sends independent packets of data,
called datagrams, from one computer to another with no guarantees about arrival. UDP is
not connection-based like TCP. Datagrams may arrive to the receiver in an arbitrary order,
some of them might be lost.

Advantages of Client Server Programming


The client server architecture system or client server programming has several advantages
over stand-alone programming:
1. It supports heterogeneous mix-up client machines. The user may be using windows 3.11,
Windows 95, Windows NT, a Mac (used in Macintosh) a UNIX work station, all of which
can be supported by the same server.
2. Computing responsibilities are sensibly allocated between client and server. The client
machine is responsible for controlling the user interface such as displaying information,
validating input and providing meaningful feedback whereas server platform is responsible
to control overall processing and computing system.
3. It has more efficiency and flexibility in selecting hardware and software components for a
new system or in implementing a client server application on existing hardware.
4. It has a good security facility so that the desired portion of hardware and software can
be locked out which provides security on unnecessary interfacing and interrupting of

05150
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

software and hardware with the user.


5. It has good facility to communicate data or information from one place to another place.

Architecture of Client Server Programming


The architecture of client server programming provides the idea about how the systems are
inter-related in computing system.
In the middle of 1980's a special system was introduced to process the application software
between two computers. A client machine that would be responsible for controlling the user
interface and a server machine that would have the relational database management system.
To control this type of mechanism a special kind of software is needed called middle-ware.
Each RDBMS vendor created two middle ware components, they are
• Proprietary client driver.
• Corresponding proprietary server driver.
Such kinds of drivers are responsible for an application program running on a client machine,
each running a different operating system, to communicate with a database on a server
machine running yet a different operating system.
Oracles middle-ware product is named SQL * .Net
There are two types of architecture commonly used in client server computing system.
• A two tier
• A three tier
It is the special type of client server programming architecture that consists of client machines
communicating directly with a database server which is shown in figure.

A Two-Tier Architecture
Any software used by the user is associated with database server, this driver is known as
proprietary client driver whereas communicating and controlling of client machines programs
is done by corresponding proprietary server driver.
Client Application SQL *.Net

Client Application SQL *.Net SQL Oracle


*.Net Dbase

Client Application SQL *.Net

Client Application Oracle Database Server


Fig. a) Two Tire Architecture Programming
Programming Logics & Techniques 151
151
5 | Standalone and Client Server Programming Concept

A Three Tier Architecture


A three-tier architecture in a client server programming architecture consisting of client
machines communicating with an application server. The application server may contain an
oracle invoked by the client application program. These stored program units communicate
with the database server, which resides on a separate machine. The main objective of using
three-tier architecture in client server programming system is to balance the system. It is used
to increase the reliability, efficiency, capacity, durability etc.

Client Application SQL *.Net


S S

Application Object
Q Q

Oracle Dbase
L L
Client Application SQL *.Net *. *.
N N
e e
t t
Client Application SQL *.Net

Client Application Object Application Oracle Database


Server

Fig. b) Three Tire Architecture Programming

Two Tier Architecture


The term 'Client/Server' has traditionally been associated with a desktop PC connected over
the network to some sort of SQL-database server. In fact, the term Client/Server formally
refers to a logical model that provides for a division of tasks into 'client' and 'server' layers
or 'tiers'. The two-tier physical representation that we have become accustomed to is actually
just one possible implementation of the Client/Server logical model. Mainframe programmers
have employed the Client/Server model for years and most mainframe applications have a
Client/Server architecture.
There are no limitations to the number of tiers an application may have. The 'three' in three-
tier represents the most common number of logical separations for an application. These
logical separations are broken down into Presentation, Application, and Data services, as
described further below.
Two tier Client/Server provides a basic separation of tasks. The client, or first tier, is primarily
responsible for the presentation of data to the user and the 'server,' or second tier, is primarily
responsible for supplying data services to the client. So far, so good.

25152
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

First Tier: Tasks/Services


Client • User Interface
• Presentation services
• Application services

Second Tier: Tasks/Services


Data Server • Application services
• Business services
• Data services

Fig.: Two-tier Client/Server architecture

Presentation services
'Presentation services' refers to the portion of the application which presents data to the
user. In addition, it also provides for the mechanisms in which the user will interact with
the data. More simply put, presentation logic defines and interacts with the user interface.
The presentation of the data should generally not contain any validation rules. Delphi Client/
Server Suite's Rapid Application Development (RAD) approach to application development
and component architecture allows the developer to easily assemble the presentation layer and
move quickly from prototype to production.

Advantage
Understanding and maintenance is easier.

Disadvantage
Performance will be reduced when there are more users.

Three-tier Architecture
A 'Multi-tier', often referred to as 'three-tier' or 'n-tier,' architecture provides greater application
scalability, lower maintenance, and increased reuse of components. Three-tier architecture
offers a technology neutral method of building Client/Server applications with vendors who
employ standard interfaces which provide services for each logical 'tier'.

Programming Logics & Techniques 153


153
5 | Standalone and Client Server Programming Concept

First Tier: Tasks/Services


Client • User Interface
• Presentation services

Second Tier: Tasks/Services


Business
Application Server • Application services
Object/Component
• Business services/objects
Business Business
Object/Component Object/Component

Third Tier: Tasks/Services


Data Server • Data services
• Data validation

Fig.: Three-tier Client/Server architecture


Through standard tiered interfaces, services are made available to the application. A single
application can employ many different services which may reside on dissimilar platforms
or are developed and maintained with different tools. This approach allows a developer to
leverage investments in existing systems while creating new application which can utilize
existing resources.

Advantages
1. High performance, lightweight persistent objects
2. Scalability – Each tier can scale horizontally
3. Performance – Because the presentation tier can cache requests, network utilization is
minimized, and the load is reduced on the application and data tiers.
4. High degree of flexibility in deployment platform and configuration
5. Better Re-usability
6. Improve data integrity
7. Improved Security – Client is not direct access to database.
8. Easy to maintain and modification is a bit easy, won’t affect other modules
9. In three tier architecture application performance is good.

45154
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Disadvantages
Increased Complexity/Effort

Multi-tier architectures
A multi-tier, three-tier, or N-tier implementation employs a three-tier logical architecture
superimposed on a distributed physical model. Application Servers can access other application
servers in order to supply services to the client application as well as supply services for other
application servers.
For example, in the diagram below the client application looks for Application Server #1 to
supply data from a mainframe based application. Application Server #1 has no direct access to
the mainframe application but, it does know, through the development of application services,
that Application Server #2 provides a service to access the data from the mainframe application
which satisfies the client request. Application Server #1 then invokes the appropriate service
on Application Server #2 and receives the requested data which is then passed on to the client.

Multi-Tier Architecture Client Client Client

Application
Server

Legacy
Application
Data Server
Server

Fig.: Multi-tier Client/Server architecture

Programming Logics & Techniques 155


155
5 | Standalone and Client Server Programming Concept

What is a Two-Tier Architecture?


Two-tier architecture is an architecture where a client talks directly to a server, with no
intervening server. It is typically used in small environments (less than 50 users).
A common error in client/server development is to prototype and apply in a small, two-tier
environment, and then scale up by simply adding more users to the server. This approach
will usually result in an ineffective system, as the server becomes overwhelmed. To scale
up properly to hundreds or thousands of users, it is usually necessary to move to three-tier
architecture.

What is a Three-Tier Architecture?


Three-tier architecture introduces a server (or an "agent") between the client and the server.
The role of the agent is manifold. It can provide translation services (as in adapting a legacy
application on a mainframe to a client/server environment), metering services (as in acting
as a transaction monitor to limit the number of simultaneous requests to a given server), or
intelligent agent services (as in mapping a request to a number of different servers, collating
the results, and returning a single response to the client.

Introduction to Web page (based) Programming


Tim Berners-Lee, a British scientist at CERN (European Organization for Nuclear Research)
(European Council for Nuclear Research), invented the World Wide Web (WWW) in 1989. The
web was originally conceived and developed to meet the demand for automatic information-
sharing between scientists in universities and institutes around the world.
The first website at CERN - and in the world - was dedicated to the World Wide Web project
itself and was hosted on Berners-Lee's NeXT computer. The website described the basic
features of the web; how to access other people's documents and how to set up your own
server. The NeXT machine - the original web server - is still at CERN. As part of the project
to restore the first website, in 2013 CERN reinstated the world's first website to its original
address.
On 30 April 1993 CERN put the World Wide Web software in the public domain. CERN made
the next release available with an open license, as a surer way to maximise its dissemination.
Through these actions, making the software required to run a web server freely available,
along with a basic browser and a library of code, the web was allowed to flourish.
During the 1980's he developed a programming language called Hypertext markup language
(HTML) on which the web is based.
Internet grew explosively in 1990's There are more than 4 million server computers on the
internet each providing some type of information or service. The number of users of the in-
ternet is harder to measure. Since each service on internet is used by many people and many
millions of users are currently on line. The effective aspect of www is the use of internet. Now
65156
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

a days Internet is not only concentrated on text mode system but also it combines graphics
text, sound and animation into a rich command communication media.
A web-based application is any program that is accessed over a network connection using
HTTP, rather than existing within a device’s memory. Web-based applications often run inside
a web browser. However, web-based applications also may be client-based, where a small part
of the program is downloaded to a user’s desktop, but processing is done over the internet on
an external server.
Web-based applications are also known as web apps.
There is a lot of confusion created by the use of terms like web-based, internet-based and
cloud-based when referring to applications. Web-based applications actually encompass all
the applications that communicate with the user via HTTP. This includes light applications like
Flash games, online calculators, calendars and so on, as well as more intensive applications
such as web-based word processors and spreadsheet applications.
A key difference between cloud and web applications is architecture. A web application or
web-based application must have a continuous internet connection to function. Conversely, a
cloud application or cloud-based application performs processing tasks on a local computer or
workstation. An internet connection is required primarily for downloading or uploading data.
A web application is unusable if the remote server is unavailable. If the remote server becomes
unavailable in a cloud application, the software installed on the local user device can still
operate, although it cannot upload and download data until service at the remote server is
restored.
The difference between cloud and web applications can be illustrated with two common
productivity tools, email and word processing. Gmail, for example, is a web application
that requires only a browser and internet connection. Through the browser, it's possible
to open, write and organize messages using search and sort capabilities. All processing
logic occurs on the servers of the service provider (Google, in this example) via either the
internet's HTTP or HTTPS protocols.
A CRM application accessed through a browser under a fee-based software as a service
(SaaS) arrangement is a web application. Online banking and daily crossword puzzles are
also considered web applications that don't install software locally.
An example of a word-processing cloud application that is installed on a workstation is
Word's Microsoft Office 365. The application performs tasks locally on a machine without
an internet connection. The cloud aspect comes into play when users save work to an Office
365 cloud server.
Most of the web applications - online banking, e-ticketing, flight status checking etc. are real-
ly web applications and are limited by scalability and availability.

Programming Logics & Techniques 157


157
5 | Standalone and Client Server Programming Concept

The difference between cloud application and web application are given in the tabular format:
Sno. Cloud Application Web Application
1. The application is accessed through the The application is accessed through the
internet or other computer network internet or other computer network
2. All cloud applications are web Not all web applications are cloud
application applications.
3. Majority of the computed cycles Somewhere located elsewhere and are
happening in a data center accessible from almost anywhere
4. Inherently scalable Limited by scalability
5. Very high uptime Limited by availability
6. User Data & Business Process Store in a User Data & Business Process Store in
multiple replicated data centers single data center
7. The provided application is standardized Each customer uses its own instance of
for all customers the application.
8. Multi-tenancy solution Isolated-tenancy solution.
9. Can run on the users' computing systems Only run on the provider's web servers.
or the provider's web servers.

Simple Architecture of Web based system or Programming


A web-based system provides access to a software system using a computer and internet
connection.
Overall system programming.
Browsing Software
Pine Opera
Netscape Navigator Amaya
MS-Internet explores Hot Java
Mosaic

The overall connection system of Internet or web based program is clearly given in the figure
below. It has following components to make connection with the user.
• The internet backbone which provides the control zone of information.
• VSAT which provides the connection (Command) service between satellite and local ser-
vice provider.
• A telephone or cable network line for connection between first and user interface machine.
• To communicate information certain interlinking devices are necessary known as modem/
router which is used to modulate and demodulate (digital to analog and vice versa)
• The browsing system is done by a PC, which is used by user to access the information.

85158
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Connection Types
There exist several ways to connect to the internet. Following are these connection types
available:
• Dial-up Connection
• ISDN
• DSL
• Cable TV Internet connections
• Satellite Internet connections
• Wireless Internet Connections
• Dial-up Connection
Dial-up
Dial-up connection uses telephone line to connect PC to the internet. It requires a modem to
setup dial-up connection. This modem works as an interface between PC and the telephone line.
There is also a communication program that instructs the modem to make a call to specific
number provided by an ISP.
Dial-up connection uses either of the following protocols:
• Serial Line Internet Protocol (SLIP)
• Point to Point Protocol (PPP)
The following diagram shows the accessing internet using modem:

Internet
Fr
P

om
IS
To

IS
P

Digital Digital
Signal Signal

Modem Modem

Computer Computer
Fig.: Internet accessing using modem
ISDN
ISDN is acronym of Integrated Services Digital Network. It establishes the connection
using the phone lines which carry digital signals instead of analog signals.
There are two techniques to deliver ISDN services:
• Basic Rate Interface (BRI)
• Primary Rate Interface (PRI)

Programming Logics & Techniques 159


159
5 | Standalone and Client Server Programming Concept

Key points:
The BRI ISDN consists of three distinct channels on a single ISDN line: 64kbps B (Bearer)
channel and one 16 kbps D (Delta or Data) channels.
The PRI ISDN consists of 23 B channels and one D channels with both have operating capacity
of 64kbps individually making a total transmission rate of 1.54Mbps.
The following diagram shows accessing internet using ISDN connection:

Internet

Fr
SP

om
I
To

IS
P
Digital Digital signal travels over
Signal Digital local digital local telephone line
telephone lines

ISDN Adapter ISDN Adapter

Computer Computer
Fig.: Internet accessing using ISDN adapter

DSL
DSL is acronym of Digital Subscriber Line. It is a form of broadband connection as it
provides connection over ordinary telephone lines.
Following are the several versions of DSL technique available today:
1. Asymmetric DSL (ADSL)
2. Symmetric DSL (SDSL)
3. High bit-rate DSL (HDSL)
4. Rate adaptive DSL (RDSL)
5. Very high bit-rate DSL (VDSL)
6. ISDN DSL (IDSL)
All of the above-mentioned technologies differ in their upload and download speed, bit trans-
fer rate and level of service.

06160
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

The following diagram shows that how we can connect to internet using DSL technology:

Internet

DSL Modem
Modem

Router

Fig.: Internet accessing using DLS Modem

Cable TV Internet Connection


Cable TV Internet connection is provided through Cable TV lines. It uses coaxial cable which
is capable of transferring data at much higher speed than common telephone line.

Key Points:
A cable modem is used to access this service, provided by the cable operator.
The Cable modem comprises two connections: one for internet service and other for Cable
TV signals.
Since Cable TV internet connections share a set amount of bandwidth with a group of
customers, therefore, data transfer rate also depends on number of customers using the internet
at the same time.

Programming Logics & Techniques 161


161
5 | Standalone and Client Server Programming Concept

The following diagram shows how internet is accessed using Cable TV connection:

From ISP
Node Cable Modem

Internet
Splitter

Cable TV
Converter

Fig.: Internet accessing using cable T.V.


Satellite Internet Connection
Satellite Internet connection offers high speed connection to the internet. There are two types
of satellite internet connection: one-way connection or two-way connection.
In one-way connection, we can only download data but if we want to upload, we need a dialup
access through ISP over telephone line.
In two-way connection, we can download and upload the data by the satellite. It does not
require any dialup connection.
The following diagram shows how internet is accessed using satellite internet connection:

Satellite

Satellite Dish Network’s


operation
center

Modem

Computer Web Server


Fig.: Internet accessing using satellite

26162
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Similarly, a simple architecture supporting oracle developer 2000 for the web-based
programming is given in fig below. In this architecture the three tiers are associated to each
other to browse the information.

Client System Middle Tier Database server

Mobile Mobile
Sync
Application Module Mobile Server
Message Repositery
Mobile Generator
Oracle Life RDBMS &
Server Processor
(MGP)
Oracle Database

Oracle Lite database

Fig.: Oracle developer 2000 web based programming

The Oracle Database Lite 10g architecture consists of the Client System, Middle Tier, and the
Database Server. The Client System contains the Oracle Lite database, Oracle Lite RDBMS,
mobile applications, and a mSync (Mobile synchronous) module. The Middle Tier consists
of a Mobile Server and the MGP (message generator and processor). The Database server
contains the Mobile Server Repository.

Advantages of Web-based Programming


The advantages of web-based programs are as follows: -
1. They have very high flexibility to communicate the information.
2. There is no coupling problem even when millions of users are interfacing with the same
server at a time.
3. Browsing of text, graphics, sound, animated pictures or text is possible.
4. The programs are machine independent, known as platform independent.
5. Creating of web page is possible.
6. The sharing system is very complex, even though the possibility of data loss is negligible.
7. It handles multimedia data effortlessly.
8. It is on web based format, so accessing of very long information is possible to download
effectively.
9. You can jump from one link to another, so searching of in formation takes place efficiently.

Programming Logics & Techniques 163


163
5 | Standalone and Client Server Programming Concept

Some Web-based Language


There are so many web-based programs but HTML and Java are widely used all over the
world due to the different kinds of facilities available on it.

HTML
It stands for Hypertext markup language. A web page is created using HTML. It consists of
standardized codes known as tags that are used to define the structure of information on a web
page. These codes enable web pages to have many features including bold text, italic text,
headings, paragraph break and numbered or bulleted lists.
HTML is a way of defining the formats of the text in a web page. However, it goes further by
also being able to define placement of graphics and hypertext links. HTML is a sub language
of SGML (Standard Generalized Markup Language) SGML is a system that defines and
standardizes the structure of document. Both SGML and HTML utilize descriptive mark up to
define, the structure of an area of text.
To develop a program through HTML, the tags can be viewed using a varieties of web
browsers. HTML tags are used to define area of a document as having certain characteristic.
The tags used in HTML usually consist of a code in between two wickets. These codes are
called container tags because the formatting described by the tag affects only the text between
the tags.

<B> and </B> - For starting and ending tags for bolding.
<H1> and </H1> - For first heading.
<I> and </I> - For Italics
<jmg. src-"name of picture"> - For an image in sorting
<P> - For paragraph breaking

Q. Write a small program to print "Hello world" by HTML tags.


<html>
<head>
<title> just to print Hello world </title>
</head>
<body>
<b>
<h1> Hello world </h1>
</b>
</body>
</html>

46164
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Java Programming
Java is an object-oriented programming language that was developed after C++ , Java software
has been developed to overcome the complexity of C++.
It is the most popular because it is widely used for internet programming system. Previously
only HTML was used for creating web pages but it is difficult to depend only upon one
language for developing the application as a typical diversity exists on internet in terms of
hardware and software.
Java supports the following data types- bytes, short, int, long, float, double, char.
The looping structure is the same as those of C++. For example, if else, switch, while do, do-
while and for loop. Java programs are of two-types application and applets.
An application is a program that resides on the local hard disk on a machine. The application
program is a standalone program. All the resources that are required like runtime library are
available whereas applet is client server programming to share data in between the no of
clients.
Q. Write a program in Java to print "Nice to meet you".

// Given below is an application that prints "nice to meet you" on the screen.
// Program to display nice to meet you.
class nice
{
Public static void main (string arg [ ] )
{
System.out.println ("nice to meet you");
}
}

Basic Web Development Languages


Besides HTML and Java many more web development languages are available in the market
but most popular 10 web based programming languages are used to build nearly all webpages
on the Internet.

HTML
HTML is the standardized markup language that structures and formats content on the web.
Page elements like titles, headings, text and links are included in the HTML document. It is
one of the core technologies in use on the Internet and serves as the backbone of all webpages.

CSS
CSS (Cascading Style Sheets) is a style-sheet language that basically allows web developers
to “set it and forget it.” Paired with HTML, CSS allows a programmer to define the look and
Programming Logics & Techniques 165
165
5 | Standalone and Client Server Programming Concept

format of multiple webpages at once; elements like color, layout and fonts are specified in one
file that’s kept separate from the core code of the webpage.
These two languages provide the basic structure and style information used to create
a static webpages a page that looks the same to everyone who visits it. Many webpages now
are dynamic webpages, which are slightly tailored to each new visitor. To create these more
complex webpages, you need to add more advanced client-side and server-side scripting.

Client-side scripting
Client-side scripting — which includes HTML and CSS — is any code that runs within a web
browser. This means that the web browser temporarily downloads all the files from a web
server and, in turn, displays a static web page; you would be able to view these files even if
you lost your Internet connection (as long as you left your web browser open). JavaScript and
ActionScript are the two most commonly used client-side scripts.

JavaScript
JavaScript is the programming language that brings animation, games, apps, interactivity and
other dynamic effects to life. After HTML and CSS, it’s the most ubiquitous of the client-side
scripts. Some JavaScript applications can even run without connecting back to a web server,
which means they’ll work in a browser with or without an Internet connection.
ActionScript
ActionScript is the language used for Adobe Flash, which is especially well suited for rich
Internet applications that use Flash animation and streaming audio and video.
Whether you use ActionScript or JavaScript is a matter of personal preference, but if you want
to use the popular Adobe Flash Player software to share multimedia applications, ActionScript
is a must.

Server-Side Scripting
All websites need to be hosted (i.e. stored) in a database on a web server. Server-side scripting
simply refers to any code that facilitates the transfer of data from that web server to a browser.
It also refers to any code used to build a database or manage data on the web server itself.
Server-side scripts run on the web server, which has the power and resources to run programs
that are too resource intensive to be run by a web browser. Server-side scripts are also more
secure, because the source code remains on the web server rather than being temporarily
stored on an individual’s computer.

PHP
Used by 75 percent of all web servers, PHP is a general-purpose server-side scripting language.
The chief advantages of PHP are that it is open source, with a huge online community to
support it, and that it’s compatible across multiple platforms. PHP is most often used by
websites with lower traffic demands.
66166
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Java
According to a study conducted by W3Tech, Java is the server-side language of choice for
large-scale websites with a high volume of traffic. Sam’s Club, Amazon and Apple App
Store use Java-based web frameworks.
One potential reason for its popularity among high traffic websites is that Java frameworks
outperform other language frameworks in raw speed benchmark tests. That means faster
server-based web applications for large scale websites. Java Servlets, JSP and WebObjects
are examples of server-side solutions that use Java.
Python
Python is a general purpose, high-level programming language that puts an emphasis on code
readability; for web developers, this means they can do more with fewer lines of code than
other popular languages.
Python does this through the use of a large standard library, which keeps the actual code
short and simple. This library is a file that contains pre-coded functions, provided by the
community, which you can download to your server and use in your own code whenever a
specific task appears. Like Java, Python was designed for web servers that deal with a large
amount of traffic. Shopzilla, Yahoo Maps, and the National Weather Service are examples of
sites that use Python.
Ruby
Ruby is similar to Python in that it was designed to make programming more productive by
emphasizing short and simple code that’s concise, consistent and flexible.
Where Ruby differs is in its language or syntax. In Python, there is only one right way to
program things, and it’s efficient and fast. In Ruby, there are multiple ways to do the same
thing, and some may be faster than others. Which language you use is really a matter of
preference.
Ruby on Rails is a very common open-source web framework that enables web developers to
create dynamic websites quickly and efficiently. Like Java, Ruby is more frequently used on
web servers that deal with a large amount of traffic. Scribd, Hulu and Twitter all use Ruby.

Platform Independent
The most popular high-level language is machine independent, due to this special kind of
feature the software production field is becoming popular day by day. Similarly, in web based
programs most of the programs are machine independent. Out of them Java is most popular one.
It is difficult to depend only upon single language for developing the application as a typical
diversity exist on the client server programming fields in the terms hardware and software.
The Java can perform its uniform capability that has been compiled for different hardware and
software environments. In the case of Java, a compiler is a program that translates the source
code for another program from a programming language into executable code.

Programming Logics & Techniques 167


167
5 | Standalone and Client Server Programming Concept

This executable code may be a sequence of machine instructions that can be executed by
the CPU directly, or it may be an intermediate representation that is interpreted by a virtual
machine. This intermediate representation in Java is the Java Byte Code.
Platform independent means the execution of the program is not restricted by the type of
OS environment provided, thereby, making it possible to process the program at any type of
environment available.
Java is a platform independent language because of the bytecode magic of java. In java, when
we execute the source code, it generates the .class file comprising the bytecodes. Bytecodes
are easily interpreted by JVM (Java virtual machine) which is available with every type of
OS we install.
Whereas C and C++ are compiled languages which makes them platform dependent. The
source code written in C / C++ gets transformed into an object code which is machine and OS
dependent. That's the reason why C and C++ languages are termed as Platform Dependent.
Java is the answer to those problems that exist on the internet. In Java you can write a single
program called on applet that is platform independent. Platform independent means that the
program can be used on any platform with any operating system.
The Java has following features so that the platform requirement object be will fully fulfilled.
• No pointer
• No multiple inheritance
• No go to
• No operator overloading

In C++ we can allocate and delicate the memory by new and delete. The Java language has
an embedded auto garbage collection mechanism. The garbage collectors simplify Java
programming by automatically freeing memory when it is not required.

86168
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Questions

Solve the following questions. (each question carries 7/8 Marks)


1. Define web based programming? List out some latest web based programs and
2. Explain any one of them.
3. What is stand-alone programming? Write its advantages. Also explain about any two web
based languages.
4. What do you mean by client server programming? Differentiate between two tiers and
three tiers architecture of client server programming.
5. Is Client-Server programming being better than stand-alone programming? If yes, explain.
6. How does JAVA programming work as a platform independent system?
7. Discuss about the architecture of web based programming. Which web based language
would you prefer for developing a web application? Explain with reasons.

Write Short Notes on the following: (each question caries 5 marks)


Computer and Communication
a. Stand-alone System (SAS)
b. Stand-alone Programming Concept
c. Client Server Programming
d. Protocol
e. TCP/IP
f. UDP
g. Two-tier Architecture
h. Three-tier Architecture
i. Multi-tier Architecture
j. Web-based Programming
k. Cloud Application and Web Application
l. Connection Types
m. ADSL and SDSL
n. DSL and RDSL
o. VDSL and IDSL
p. Cable TV Internet Connection
q. Satellite Internet Connection
r. Web-based Programming Language
s. Client-side Scripting
t. Server-side Scripting
u. Platform Independent

Programming Logics & Techniques 169


169
5 | Standalone and Client Server Programming Concept

Index -1

List of Abbreviations

A
ADSL Asymmetric Digital Subscriber Line
AGP Accelerated Graphics Port
ANSI American National Standards Institute
ASME American Society of Mechanical Engineers
ASP Active Server pages

B
B-0 Business Language Version-0
BASIC Beginner’s All-Purpose Instruction Code
BCPL Baltimore County Public Library
BIOS Basic Input Output system
BPR Business Process Re-engineering
BRI Basic Rate Interface

C
CASE Computer Aided(Assisted) Software/System Engineering
CCS Cascading Style Sheets
CDROM Compact Disk read Only memory
CEO Chief Executive Officer
CERN European Organization for Nuclear Research
COBOL Common Business Oriented language
CODASYL Conference on Data Systems Languages
COM Component Object Model
CORBA Common Object Request Broker Architecture
CPU Central Processing Unit
CRM Customer Relationship Management
CRT Cathode Ray Tube

D
DCOM Distributed Component Object Model

07170
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

DDL Data Description Language


DFD Data Flow Diagram
DML Data Manipulation Language
DSDM Dynamic Systems Development Method
DSL Digital Subscriber Line
DVD Digital Versatile Disk

E
ETH Ethan Allen Interiors, Inc.

F
FORTRAN Formula Translator
FTP File Transfer Protocol

G
GL Generation of Language
GNU Gnus Not Unix
GUI Graphical User Interfaces
GWBASIC Gee-Whiz BASIC

H
HAL Heuristically Programmed ALgorithmic
HLD High Level Design
HLL High Level Language
HTML Hyper Text Markup Language
HTTP Hyper Text Transfer Protocol

I
I/P Input
IBM International Business Machine
ICT Information Communication Technology
ISDN Integrated Services Digital Network
ISO International Standard Organization/International Organization for
Standardization
ISP Internet Service Provider
IT Information Technology

Programming Logics & Techniques 171


171
5 | Standalone and Client Server Programming Concept

J
JAVA Just Another Vague Acronym
JSP Java Server Pages

L
LAN Local Area Network
LCD Liquid Crystal Display
LED Light Emitting Diode
LISP List Processing
LLD Low Level Design
LLL Low Level Language
LOGO Language of Graphic Oriented

M
MAN Metropolitan Area Network
MGP Messaging Gateway Protocol/ Message Generator and Processor
MICR Magnetic Ink Character Recognition

N
NOS Network Operating System
NT New Technology

O
O/P Output
OCR Optical Character Recognition
OMR Optical Mark Recognition
OOAD Object Oriented Analysis and Design
OOPS Object Oriented Programming System
ORACLE Oak Ridge Automatic Computer and Logical Engine
OS Operating System

P
PC Personal Computer
PDQ Parallel Data Query
PHP PHP: Hypertext Preprocessor (earlier called Personal Home Page)
PL Programming Language

27172
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

PM Planned/Preventive Maintenance
PPM Planned Preventive Maintenance
PPT Point to Point Protocol
PRI Primary rate Interface
PROLOG PROgramming in LOGic

Q
QBASIC Quick BASIC
QBE Query By example
QoS Quality of Service

R
RAD Rapid Application Development
RAM Random Access Memory
RDBMS Relational Database Management System
ROI Return on Investment
ROM Read Only Memory
RPMS Revolution Per Minutes

S
SaaS Software as a Service
SAS Stand Alone System
SDLC System Development Life Cycle
SDM System Development Method
SGML Standard Generalized Markup Language
SLIP Serial Line Internet Protocol
SQL Structure Query Language
SSADM Structured Systems Analysis and Design Method

T
TCP/IP Transmission Control Protocol/ Internet Protocol
TV Television

U
UDP User Diagram Protocol
UML Unified Modeling Language

Programming Logics & Techniques 173


173
5 | Standalone and Client Server Programming Concept

UNIVAC Universal Non-Integrated Vacuum Actuated Computer/ UNIVersal


Automatic Computer
UNIX UNiplexed Information and Computing System
US United States

V
VAT Value Added Tax
VCR Video Cassette Recorder
VGA Video Graphics Array
VoIP Voice over Internet Protocol
VS Versus
VSAT Very Small Aperture Terminal

W
WAN Wide Area Network
WWW World Wide Web

X
XML EXtensible Markup Language

47174
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

Index-2

CMP 124.3
Programming Logics and Techniques (3-0-0)
Evaluation:
Theory Practical Total
Sessional 50 - 50
Final 50 - 50
Total 100 - 100

Course Objectives:
This course is designed to acquaint the student with the concept off fundamental
problem analysis, modeling and coding techniques.

Course Contents:
1. Programming Languages 14 hours
1.1 Introduction
1.2 Analogy with Natural Language
1.3 Classification of Computer Language
(Low Level Language and High-Level Language)
1.3.1 Low Level Languages, (Machine and Assembly Language)
1.3.2 Advantages and Disadvantages of Machine Level Language
1.3.3 Advantages of Assembly Language over Machine Level Language
1.3.4 Disadvantages of Assembly Language
1.4 High Level Language
1.4.1 Advantages and Limitations of High Level Language
1.4.2 Difference between Low Level and High-Level Language
1.4.3 Program Language Translator
1.4.3.1 Types of Translators (Compiler, Assembler and Interpreter)
1.4.3.2 Difference among Translators
1.5 Linker and Loader
1.5.1 Types of Linker and Loader
1.6 Generation of Computer Languages
1.6.1 3GL and 4GL
1.6.2 Advantages of 4GL over 3GL
1.6.3 Feature of 4GL (Object Oriented Language)
1.7 Some Important Types of High Level Language
1.8 Machine Independence and Portability of programs
Programming Logics & Techniques 175
175
5 | Standalone and Client Server Programming Concept

2. Software Development (Program Development) 10 hours


2.1 Introduction to program development/software development
2.2 Program Development Life Cycle
2.2.1 Problem Identification
2.2.2 Problem Analysis/Requirement Analysis
2.2.3 Program Design
Phases of Program Design (Data design, Input, Output, Procedure,
File design)
2.2.4 Program Coding
2.2.5 Program Testing and Debugging
2.2.6 Program Delivery/Implementation and Evaluation
2.2.7 Program Maintenance
2.2.8 Documentation
2.3 Programming Tools
2.3.1 Algorithm
2.3.2 Flowchart
2.3.3 Decision Table
2.3.4 Pseudocode
2.4 Comparison of Programming Tools
2.5 Advantages and Disadvantages of Programming Tools
2.6 Logics to Program Development
2.6.1 Types of Logics (Sequential, Selection Iteration and Recursion)
2.6.2 Differentiation
2.7 Symbols and some examples

3. Programming Techniques 8 hours


3.1 Introduction
3.2 Type of Programming Technique (Approaches)
3.2.1 Modular, Top down, bottom up, Structured and Object-Oriented
approach
3.2.2 Advantages and Disadvantages
3.3 Program Development Methods (Models)
3.3.1 Types of Program Development Models (Water fall or Traditional model,
Prototype or Transformation model, Spiral model, Iterative model,
V-model, RAD model, Big-bang model, Evolutionary models)
3.3.2 Advantages and Disadvantages of Waterfall, Prototype and Spiral Models
(Simple Introduction to other Models)
3.4 Cohesion and Coupling
3.4.1 Types of Cohesion and Coupling
3.4.2 Use of Cohesion and Coupling in Program Development
3.5 Communication between Modules

67176
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

4. Program Maintenance 8 hours


4.1 Introduction
4.2 Types of Program Maintenance (Corrective maintenance,
Adoptive maintenance, Perfective maintenance, Emergency maintenance)
4.3 Problem Areas in Program Maintenance
4.4 Cost Issues in Software Maintenance
4.5 Impact of Software Errors
4.6 Program Documentation and Its Standards
4.6.1 Requirements of Documentation
4.6.2 Importance of Documentation
4.6.3 Types of Documentation
4.7 Program Specification
4.8 System Flow Chart
4.8.1 Elements of System Flowcharts
4.8.2 Examples
4.9 Data Flow Diagram
4.9.1 Element of DFD
4.9.2 Labeling the data flow diagram
4.9.3 Idea for Drawing DFD
4.9.4 Examples

5. Standalone and Client Server Programming Concept 8 hours


5.1 Introduction to Standalone Programming concept
5.1.1 Advantages and limitations of Standalone Programming
5.2 Introduction to Client Server Programming (CSP)
5.2.1 Advantages and Disadvantages of CSP
5.2.2 Distinguish between Standalone and Client Server Programming
5.2.3 Client Server Programming Architecture
5.5 Introduction to Web-based Programming
5.5.1 Advantages and Disadvantages of Web-based Programs
5.5.2 Architecture of Web-based Programming
5.5.2 Web-based System and Programming
5.6 Introduction to A Few Web based Languages and Their Capabilities
5.7 Requirement of Platform-Independent System

Reference Books:
a. V.K. Jain: Computer Fundamentals, BPB Publication
b. Foundations of Computing, BPB Publication (Third Edition)

Programming Logics & Techniques 177


177
5 | Standalone and Client Server Programming Concept

Index -3

Question Sample Model


POKHARA UNIVERSITY
Level: Bachelor Semester - Spring Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) Define Programming Language. Write difference between program and software. 8
b) Explain the programming language generations with their specific features. 7
2. a) What is translator program? What is the function of interpreter in a High Level
Programming Language? 2+5
b) Define PDLC? Explain different phases of program design in brief. 2+6
3. a) What is program coding? Write down the differences between debugging and testing.
2+5
b) Define Algorithm and Flowchart? Draw a flow chart to calculate square and square
root of an entered number through keyboard. 3+5
4. a) Define the programming techniques (Approaches)? 2+6
Write down differences between structured programming and modular programming
approaches.
b) What is waterfall model? Why waterfall model is only suitable for traditional
programming? Give suitable example for your appropriate answer. 2+5
OR
5. a) Define program maintenance. Explain different types of program maintenance with
cost factors. 2+5
OR
Define program documentation. Explain different types of program documentation
with examples.
b) Define DFD Elements. Draw a DFD to show Students Evaluation System of a College
by assuming DFD elements? 3+5
6. a) Define Standalone programming concept. "Client Server Programming is demand of
today's organizations" Justify the statement with architectural diagram. 2+5
b) Define web-based program? List out some web based programming languages and
explain any one of them. 2+6
7. Write short notes on any two: 2*5
a) Programming Errors
b) Prototype Model
c) Impacts of Software maintenance
87178
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


1. a) What are the functions of language processor? Compare and contrast compiler and
interpreter with functional diagrams. 2+6
b) What is a linker? Explain the need of machine independence and portability of
programs. 3+4
2. a) Define 4GL. Explain the future use of 4GL, with its merits and demerits. 2+3+3
b) Which one is an important programming tool in program development and why ?
Draw a flowchart to display even and odd number from the any given number N.1+6
3. a) What is program documentation? In what condition is this document more useful. 2+5
b) Write the importance of DFD. Draw the DFD to enroll in BCA first semester program
under Pokhara University. 3+5
4. a) List the types of program development models. Explain V-model & Big Bang Model.
1+3+3
b) Differentiate between structured programming and object-oriented programming. 8
5. a) Define program maintenance in program development. What is the role of budget
allocation while developing a good program? 2+5
b) Define program maintenance. What are the problematic areas in program maintenance?
2+6
6. a) Define web based programming? List out some latest web based programs and explain
any one of them. 2+5
b) "Machine independence and portability are the necessary characteristics of standard
software". Justify the statement. 8
7. Write short notes on any two: 2x5
a) Modular programming
b) CSP Architecture
c) Pseudo code

Programming Logics & Techniques 179


179
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


1. a) Define programming language. List out the advantages and limitations of high-level
language. 8
b) What is a linker? Explain the need of machine independence and portability of
programs. 7
2. a) Define 4GL. Explain the future use of 4GL, with its merits and demerits. 8
b) Differentiate between compiler and interpreter with suitable examples. 7
3. a) Define flowchart? Construct a flowchart to find Fibonacci series up to nth term. 2+5
b) What do you mean by feasibility analysis? Explain different types of feasibility
analysis. 2+6
4. a) Define program maintenance. What are the problematic areas in program
maintenance? 2+4
b) What do you mean by DFD? Differentiate between DFD and Flowchart? 2+7
5. a) Define cohesion and coupling. Also, explain any three types of cohesion and coupling
techniques. 2+5
b) What is stand alone programming? Write its advantages. Also explain about any two
web based languages. 1+3+4
6. a) What do you mean by client server programming? Differentiate between two tiers
and three tiers architecture of client server programming. 4+4
b) Compare iteration and recursion process with suitable examples. 7
7. Write short notes on any two: 2*5
a) Decision Table
b) Waterfall Model of SDLC
c) System Analyst

08180
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


1. a) What is natural language? “High level language is better than low level language”.
Justify this statement. 7
b) What is interpreter? Differentiate between compiler and interpreter. 8
2. a) Explain the top down programming technique with an example. 8
b) Write down the flowchart to find the factorial of any given number N and explain. 7
3. a) Draw a flow chart to ask three numbers and find out the largest number. 7
b) A bank defined the rate of interest on fixed deposit account as follows. 8
i) If the amount is at least Rs.20000 and time 1 year = 5%.
ii) If the amount is at least Rs.20000 and time 2 years = 7%.
iii) If the amount is at least Rs.20000 and time 3 years = 9%.
iv) If the amount is at least Rs.20000 and time 4 years = 10%.
v) There is no matter of amount if the time is more than 4 years =11%
Express these statements in the form of decision table.
4. a) Explain Spiral Model of Program Development. Give an example to use this model
in an organization. 8
b) What are cohesion and coupling? Explain with examples. 7
5. a) Explain the top down programming technique with an example. 7
b) Describe Data Flow Diagram with a suitable example. 8
6. a) Is Client-Server programming better than stand-alone programming? If yes, explain
how? 7
b) Explain the iterative and recursive logic with examples 8
7 Write short notes on (Any Two) 2×5
a) Object Oriented Programming
b) Need of Platform Independent Program
c) Decision Table

Programming Logics & Techniques 181


181
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) What do you mean by fourth generation language (4GL)? Discuss its advantages
and limitations. 8
b) Compare and contrast low level language with high level language. 7
2. a) What do you understand by program development? Does requirement analysis
play important role while system development? Justify your answer with suitable
reasons. 7
b) Assume the tax system of any company as:
• If the employee is male and annual salary is <=2,00,000 then no income tax.
• If the employee is female and annual salary is <=2,00,000 then 5% tax on total
salary.
• If the employee is male and salary is above 2,00,000 but <=3,00,000 then 10 %
income tax on total salary.
• If the employee is female and annual salary is above 2,00,000 but <=3,00,000
then 12 % income tax on the total salary.
• If annual salary is more than 3,00,000 then 20% income tax on total salary for
all employees.
Now construct a decision table to represent the above conditions. 8
3. a) Explain in details about the spiral model of program development with the help of
diagram. 7
b) Define iterative and recursive logic of program development with suitable
example. 8
4. a) What is program maintenance? What are the impact of poor software maintenance
budget while system development and planning? 7
b) What is the significance of DFD? Differentiate between DFD and Flowchart. 8
5. a) Why do you use mostly client server programming rather than standalone
programming? Also show the architecture of the client server programming. 8
b) How does JAVA programming work as a platform independent system? 7
6. a) How modules communicate with each other? Explain.
b) Explain the need for testing and debugging in program development.
c) Explain the importance of compilers and interpreters in programming language. 3×5
7. Write short notes on: (Any Two) 2x5
a) Program design and program coding
b) Object Oriented Programming c) Prototype of program development
28182
1 Programming Logics & Techniques
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) What do you mean by program language translator? Compare and contrast between compiler
and interpreter. 8
b) Explain the computer programming language generations with classification diagram. 7
2. a) Discuss the need of loader and linker. Is it essential for a programming language to
attain machine independence? Justify you answer with reference to some well-known
programming language. 8
b) Explain flowchart and algorithm along with its uses in program development. Draw a flow
chart to find the sum of the digits of the input number. 7
3. a) What types of program designing tools are widely used for software development? Draw
a flow chart to ask marks obtained in any five subjects in Semester End Examination and
calculate total marks, percentage of marks and division where if:
percentage>=90 : ‘A Grade’ 8
percentage>=80 & percentage <90 : ‘B Grade’
percentage>=70 & percentage<80 : ‘C Grade’
percentage>=60 & percentage<70 : ‘D Grade’
percentage>=45 & percentage<60 : ‘E Grade’ otherwise ‘Fail’.
b) Why is it essential to follow software development life cycle? How are design and analysis
related to each other? Illustrate your understanding with a relevant example. 7
4. a) What are the Program Development Models (methods)? Which type of model do you
suggest for developing a project whose requirements are not clearly provided by the client?
Provide reasons to support your answer. 7
b) How can the communication between modules be done? Differentiate between cohesion
and coupling. 8
5. a) Explain Data flow diagram with its elements. Draw a neat DFD for College Student
Registration System 8
b) What are different cost issues to be considered in software maintenance? Explain with
examples. 7
6. a) What do you mean by Standalone and Client-Server programming? Is client-server
programming is better than Standalone programming? If yes, explain how? 8
b) Discuss the architecture of web based programming. Which web based language would you
prefer for developing a web application? Explain with reasons. 7
7. Write short note on any two:
• Good documentation
• Natural programing Language (NPL)
• Modular designing and programming 2×5
Programming Logics & Techniques 183
183
5 | Standalone and Client Server Programming Concept

POKHARA UNIVERSITY
Level: Bachelor Semester - Fall Year : 20XX
Programme: BCA Full Marks: 100
Course: Programming Logic and Techniques Pass Marks: 45
Time : 3hrs.
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


1. a) What are the functions of language processor? Distinguish between compiler and
interpreter. 2+6
b) What is a linker? Explain the need of machine independence and portability of
programs. 3+4
2. a) Define 4GL. Explain the future use of 4GL, with its merits and demerits. 7
b) Which one is an importance programming model in program development and
why? Draw a flow chart to display the fibonacci series of number from the any
given number N. 8
3. a) What is program documentation? In what condition this documentation is more
useful. 2+5
b) Write the importance of DFD. Draw the DFD to enroll students in BCA first
semester program under Pokhara University. 3+5
4. a) List the types of program development models. Explain V-model & Big Bang
model. 1+3+3
b) Differentiate between structured programming and object-oriented programming. 8
5. a) Define program maintenance in program development. What is the role of budget
allocation while developing a good program? 2+5
b) Define program maintenance. Discuss various types of program maintenance. 2+6
6. a) Define web based programming? List out some latest web-based programs and
explain any one. 2+5
b) "Machine independence and portability are the necessary characteristics of standard
software". Justify the statement. 8
7. Write short notes on any two: 2×5
• Modular programming
• Decision Tree
• Pseudocode

48184
1 Programming Logics & Techniques

You might also like