Unit 1
Unit 1
com
What is a language?
Language is the mechanism of communication to share ideas, thoughts, and opinions with each
other. For instance, if we want to communicate with someone, we need a language that can be any
of the languages that both the communicators’ know. It can be English, Hindi, Spanish, or another
language. But you need at least one language to communicate with someone (human/person).
What is a programming language?
Programming language is how we can talk to computers. It's a lot like English but it's kind of
quirky too. Unlike people, machines cannot guess our intent. We have to be super meticulous and
describe what we want in every little detail.
To communicate with a person, you need a language. In the same way, if you need to communicate
with the computer, you need a programming language. Without a programming language, you
cannot communicate with the computer.
A programming language is a set of rules that provide a way of telling computer what operation to
perform. A programming language include set of rules for communication. It provides a linguistic
framework for describe computations. A programming language is a notational system for
describing computation in a machine readable and human readable form. A programming
language is a tool for developing executable models for a class or problem domain. English is a
natural language, it has words, symbols and grammatical rules. Similarly each programming
language has a different set of syntax rules. Programming language can be used to create programs
that control the behavior of a computer and server any purpose.
Hence, programming language is the medium of communication between human and computer
systems. It is the set of instructions written in a specific style (coding) to instruct the computer to
perform a specific task.
Most computer programming languages were inspired by or built upon concepts from previous
computer programming languages. Today, while older languages still serve as a strong foundation
for new ones, newer computer programming languages make programmers’ work simpler
The first computer programming language was created in 1883, when a woman named Ada
Lovelace worked with Charles Babbage on his very early mechanical computer, the Analytical
Engine. While Babbage was concerned with simply computing numbers, Lovelace saw that the
numbers the computer worked with could represent something other than just amounts of things.
She wrote an algorithm for the Analytical Engine that was the first of its kind. Because of her
contribution, Lovelace is credited with creating the first computer programming language. As
1
C Programming BCA-TU [email protected]
different needs have arisen and new devices have been created, many more languages have
followed.
1883: Algorithm for the Analytical Engine: Created by Ada Lovelace for Charles Babbage’s
Analytical Engine to compute Bernoulli numbers, it’s considered to be the first computer Commented [SoI1]: Bernoulli numbers are used in
programming language. some series expansions of several
functions (trigonometric, hyperbolic, gamma,
etc.), and are extremely important in number theory
1949: Assembly Language: First widely used in the Electronic Delay Storage Automatic and analysis.
Calculator, assembly language is a type of low-level computer programming language that
simplifies the language of machine code, the specific instructions needed to tell the computer what
to do.
1952: Autocode: Autocode was a generic term for a family of early computer programming
languages. The first was developed by Alick Glennie for the Mark 1 computer at the University of
Manchester in the U.K. Some consider auto code to be the first compiled computer programming
language, meaning that it can be translated directly into machine code using a program called a
compiler.
1957: FORTRAN: A computer programming language created by John Backus for complicated
scientific, mathematical, and statistical work, FORTRAN stands for Formula Translation. It is the
one of the oldest computer programming languages still used today.
1958: Algol: Created by a committee for scientific use, Algol stands for Algorithmic Language.
Algol served as a starting point in the development of languages such as Pascal, C, C++, and Java.
1959: COBOL: Created by Dr. Grace Murray Hopper as a computer programming language
that could run on all brands and types of computers, COBOL stands
for COmmon Business Oriented Language. It is used in ATMs, credit card processing, telephone
systems, hospital and government computers, automotive systems, and traffic signals. In the
movie The Terminator, pieces of COBOL source code were used in the Terminator’s vision
display.
1959: LISP: Created by John McCarthy of MIT, LISP is still in use. It stands for LISt Processing
language. It was originally created for artificial intelligence research but today can be used in
situations where Ruby or Python are used.
1964: BASIC: Developed by John G. Kemeny and Thomas E. Kurtz at Dartmouth College so that
students who did not have a strong technical or mathematical understanding could still use
computers, it stands for Beginner’s All-purpose Symbolic Instruction Code. A modified version of
BASIC was written by Bill Gates and Paul Allen. This was to become the first Microsoft product.
1970: Pascal: Developed by Niklaus Wirth, Pascal was named in honor of the French
mathematician, physicist, and philosopher Blaise Pascal. It is easy to learn and was originally
created as a tool for teaching computer programming. Pascal was the main language used for
software development in Apple’s early years.
2
C Programming BCA-TU [email protected]
1972: Smalltalk: Developed by Alan Kay, Adele Goldberg, and Dan Ingalls at Xerox Palo Alto
Research Center, Smalltalk allowed computer programmers to modify code on the fly and also
introduced other aspects now present in common computer programming languages including
Python, Java, and Ruby.
1972: C: Developed by Dennis Ritchie at Bell Labs, C is considered by many to be the first high-
level language. A high-level computer programming language is closer to human language and
more removed from the machine code? C was created so that an operating system called UNIX
could be used on many different types of computers. It has influenced many other languages,
including Ruby, C#, Go, Java, JavaScript, Perl, PHP, and Python.
1972: SQL: SQL was developed by Donald D. Chamberlin and Raymond F. Boyce at IBM. SQL
stands for Structured Query Language. It is used for viewing and changing information that is
stored in databases. SQL uses command sentences called queries to add, remove, or view data.
1978: MATLAB: Developed by Cleve Moler. MATLAB stands for Matrix Laboratory. It is
one of the best computer programming languages for writing mathematical programs and is mainly
used in mathematics, research, and education. It can also be used to create two- and three-
dimensional graphics.
1983: Objective-C: Created by Brad Cox and Tom Love, Objective-C is the main computer
programming language used when writing software for macOS and iOS, Apple’s operating
systems.
1983: C++: C++ is an extension of the C language and was developed by Bjarne Stroustrup. It is
one of the most widely used languages in the world. C++ is used in game engines and high-
performance software like Adobe Photoshop. Most packaged software is still written in C++.
1987: Perl: Perl was originally developed by Larry Wall in 1987 as a scripting language designed
for text editing. Its purpose was to make report processing easier. It is now widely used for many
purposes, including Linux system administration, Web development, and network programming.
1990: Haskell: Named after Haskell Brooks Curry, an American logician and mathematician.
Haskell is called a purely functional computer programming language, which basically means that
it is mostly mathematical. It is used by many industries, especially those that deal with complicated
calculations, records, and number-crunching.
3
C Programming BCA-TU [email protected]
1991: Python: Designed by Guido Van Rossum, Python is easier to read and requires fewer lines
of code than many other computer programming languages. It was named after the British comedy
group Monty Python. Popular sites like Instagram use frameworks that are written in Python.
1991: Visual Basic: Developed by Microsoft, Visual Basic allows programmers to choose and
change pre-selected chunks of code in a drag-and-drop fashion through a graphical user interface
(GUI).
1993: R: Developed by Ross Ihaka and Robert Gentleman at the University Of Auckland, New
Zealand, R is named after the first names of the first two authors. It is mostly used by statisticians
and those performing different types of data analysis.
1994: PHP: Created by Rasmus Lerdorf, PHP is used mostly for Web development and is usually
run on Web servers. It originally stood for Personal Home Page, as it was used by Lerdorf to
manage his own online information. PHP is now widely used to build websites and blogs.
WordPress, a popular website creation tool, is written using PHP.
1995: Java: Originally called Oak, Java was developed by Sun Microsystems. It was intended for
cable boxes and hand-held devices but was later enhanced so it could be used to deliver information
on the World Wide Web. Java is everywhere, from computers to smartphones to parking meters.
Three billion devices run Java!
1995: Ruby: Ruby was created by Yukihiro “Matz” Matsumoto, who combined parts of his
favorite languages to form a new general-purpose computer programming language that can
perform many programming tasks. It is popular in Web application development. Ruby code
executes more slowly, but it allows for computer programmers to quickly put together and run a
program.
1995: JavaScript: Created in just 10 days by Brendan Eich, this language is mostly used to
enhance many Web browser interactions. Almost every major website uses JavaScript.
2000: C#: Developed by Microsoft with the goal of combining the computing ability of C++ with
the simplicity of Visual Basic, C# is based on C++ and is similar to Java in many aspects. It is
used in almost all Microsoft products and is primarily used for developing desktop applications.
2003: Scala: Created by Martin Odersky. Scala is a computer programming language that
combines functional programming, which is mathematical, with object-oriented programming,
which is organized around data that controls access to code. Its compatibility with Java makes it
helpful in Android development.
2003: Groovy: Developed by James Strachan and Bob McWhirter, Groovy is derived from Java
and improves the productivity of developers because it is easy to learn and concise.
2009: Go: Go was developed by Google to address problems that can occur in large software
systems. Since computer and technology use is much different today than it was when languages
such as C++, Java, and Python were introduced and put to use, problems arose when huge
computer systems became common. Go was intended to improve the working environment for
programmers so they could write, read, and maintain large software systems more efficiently.
4
C Programming BCA-TU [email protected]
2009:Node.js: Node.js was written initially by Ryan Dahl in 2009, about thirteen years after the
introduction of the first server-side JavaScript environment, Netscape's LiveWire Pro Web. The
initial release supported only Linux and Mac OS X. Its development and maintenance was led by
Dahl and later sponsored by Joyent.
2011: React: It was created by Jordan Walke, a software engineer at Facebook, who released an
early prototype of React called "FaxJS". He was influenced by XHP, an HTML component library
for PHP. It was first deployed on Facebook's News Feed in 2011 and later on Instagram in 2012.
It was open-sourced at JSConf US in May 2013.
2011: Dart: The project was founded by Lars Bak and Kasper Lund. Dart is a client-optimized
programming language for apps on multiple platforms. It is developed by Google and is used to
build mobile, desktop, server, and web applications. Dart is an object-oriented, class-based,
garbage-collected language with C-style syntax. Dart can compile to either native code or
JavaScript.
2014: Swift: Developed by Apple as a replacement for C, C++, and Objective-C, Swift is
supposed to be easier to use and allows less room for mistakes. It is versatile and can be used for
desktop and mobile apps and cloud services.
From the first generation and now fourth generation of the Computers there were several
programming languages used to communicate with the Computer. Different types of programming
language are:
Low level language
o Machine language (1 GL)
o Assembly language (2 GL)
High level language
o Procedural oriented language (3 GL)
o Problem oriented language (4 GL)
o Natural language (5 GL)
5
C Programming BCA-TU [email protected]
communicating with a Computer. It is written in machine code which represents 0 and 1 binary
digits inside the Computer string which makes it easy to understand and perform the
operations. As we know a Computer system can recognize electric signals so here 0 stands for
turning off electric pulse and 1 stands for turning on electric pulse. It is very easy to understand
by the Computer and also increases the processing speed.
Advantages:
The main advantage of using Machine language is that there is no need of a translator or
interpreter to translate the code, as the Computer directly can understand.
It is directly understood by the processor so has faster execution time since the programs
written in this language need not to be translated.
It doesn’t need larger memory
Disadvantages:
It is very difficult to program using 1GL since all the instructions are to be represented by
0s and 1s.
Use of this language makes programming time consuming.
It is difficult to find error and to debug.
It can be used by experts only.
6
C Programming BCA-TU [email protected]
Being machine dependent language, programs written in this language are very less or
not portable.
Programmers must know its mnemonics codes to perform any task.
Advantages:
7
C Programming BCA-TU [email protected]
Disadvantages:
It is easier but needs higher processor and larger memory.
It needs to be translated therefore its execution time is more.
Language Processor
As we studied about different types of programming language which can be written to perform
certain task. The programs are written mostly in high level languages like Java, C++, and Python
etc. and are called source code. These source code cannot be executed directly by the computer
and must be converted into machine language to be executed because a computer understands
instructions in machine code, i.e. in the form of 0s and 1s. Hence, a special translator system
software is used to translate the program written in high-level language into machine code is
called Language Processor is needed which translate into machine code (object program / object
code). Hence Language processor is a special types of software application which is designed or
used to perform tasks such as processing program code or source code into machine code.
Different types of language processor are:
Compiler
Interpreter
Assembler
Compiler
A compiler is a program that converts the instructions of high-level language into machine
language as a whole. The language processor that reads the complete source program written in
high level language as a whole in one time and translates it into an equivalent program in machine
language is called as a Compiler. The source code is translated to object code successfully if it is
free of errors. The compiler specifies the errors at the end of compilation with line numbers when
8
C Programming BCA-TU [email protected]
there are any errors in the source code. The errors must be removed before the compiler can
successfully recompile the source code again. Language like C, C++, C#, Java use compiler.
Advantages
Producers and executable file, and therefore the program can be run without need of the
source code.
A compiler converts a high-level program that can be executed many times.
Disadvantages
Interpreter
An interpreter is a computer program that performs a translation of high level programming
language code to low level language machine code. The translation of single statement of source
program into machine code is done by language processor and executes it immediately before
moving on to the next line is called an interpreter. If there is an error in the statement, the interpreter
terminates its translating process at that statement and displays an error message. The interpreter
moves on to the next line for execution only after removal of the error. An Interpreter directly
executes instructions written in a programming or scripting language without previously
converting them to an object code or machine code. Interpreter is slower than compiler. First
interpreter convert source code to intermediate code and then execute it line by line. Language
like Perl, Python and MATLAB, PHP use interpreter.
Advantages
Interpreter is that it makes easy to trace out and correct errors in the source program.
Interpreters over compilers are that an error is found immediately.
9
C Programming BCA-TU [email protected]
Disadvantages
Assembler
The Assembler is used to convert the program written in Assembly language program into machine
code. The source program is an input of assembler that contains assembly language instructions.
The output generated by assembler is the object code or machine code understandable by the
computer.
Advantages
Disadvantages
Compiler Interpreter
A compiler takes the whole program as a single unit and Interpreter each line in translated or converted one by one
compiles it at once and executed
10
C Programming BCA-TU [email protected]
Compiler Interpreter
Translator program is required to translate the program Translator program is not required to translate the
each time you want to run the program. program each time you want to run the program.
More useful for commercial purpose More useful for learning purpose
Compiler are good for a very long program Interpreter is good for small programs.
Example :C compiler, PASCAL compiler, FORTRAN Example : Basic interpreter, Prolog interpreter, LISP,
compiler etc. APL, Perl, Python, PHP etc.
Program
A computer program is the expression, in a certain language, of a calculation or procedure - but also the
expression of certain objects.
In simple word, Program is an organized specific set of ordered instructions which is written to perform
specific task or operation. A collection of interrelated program is used to create software program for
specific domain. Typically, the program is put into a storage area accessible to the computer. The computer
gets one instruction and performs it and then gets the next instruction. The storage area or memory can also
contain the data that the instruction operates on.
When you create a program, you write it using some kind of computer language. Your language statements
are the source program. You then "compile" the source program (with a special program called a language
compiler) and the result is called an object program (not to be confused with object-oriented programming).
There are several synonyms for object program, including object module and compiled program. The object
program contains the string of 0s and 1s called machine language that the logic processor works with.
Every computer requires appropriate instruction set (programs) to perform the required task. The quality of
the processing depends upon the given instructions. If the instructions are improper or incorrect, then it is
obvious that the result will be superfluous.
Therefore, proper and correct instructions should be provided to the computer so that it can provide the
desired output. Hence, a program should be developed in such a way that it ensures proper functionality of
the computer. In addition, a program should be written in such a manner that it is easier to understand the
underlying logic.
A good computer program should have following characteristics:
Efficiency: Every program requires certain processing time and memory to process the instructions
and data. As the processing power and memory are the most precious resources of a computer, a
11
C Programming BCA-TU [email protected]
program should be laid out in such a manner that it utilizes the least amount of memory and
processing time.
Structural: To develop a program, the task must be broken down into a number of subtasks. These
subtasks are developed independently, and each subtask is able to perform the assigned job without
the help of any other subtask. If a program is developed structurally, it becomes more readable, and
the testing and documentation process also gets easier.
Readability: The program should be written in such a way that it makes other programmers or
users to follow the logic of the program without much effort. If a program is written structurally, it
helps the programmers to understand their own program in a better way. Even if some
computational efficiency needs to be sacrificed for better readability, it is advisable to use a more
user-friendly approach, unless the processing of an application is of utmost importance.
Flexibility: A program should be flexible enough to handle most of the changes without having to
rewrite the entire program. Most of the programs are developed for a certain period and they require
modifications from time to time. For example, in case of payroll management, as the time
progresses, some employees may leave the company while some others may join. Hence, the
payroll application should be flexible enough to incorporate all the changes without having to
reconstruct the entire application.
Generality: Apart from flexibility, the program should also be general. Generality means that if a
program is developed for a particular task, then it should also be used for all similar tasks of the
same domain. For example, if a program is developed for a particular organization, then it should
suit all the other similar organizations.
Documentation: Documentation is one of the most important components of an application
development. Even if a program is developed following the best programming practices, it will be
rendered useless if the end user is not able to fully utilize the functionality of the application. A
well-documented application is also useful for other programmers because even in the absence of
the author, they can understand it.
Error in Program
Errors are the mistakes or faults in the program that causes our program to behave unexpectedly
and it is no doubt that the well versed and experienced programmers also makes mistakes.
Programming error are generally known as Bugs and the process to remove bugs from program is
called as Debug/Debugging.
Also, error is an illegal operation performed by the user which results in abnormal working of the
program. Programming errors often remain undetected until the program is compiled or executed.
12
C Programming BCA-TU [email protected]
Some of the errors prevent the program from getting compiled or executed. Thus errors should be
removed before compiling and executing.
Syntax errors
Errors that occur when you violate the rules of writing C/C++ syntax are known as syntax errors.
This compiler error indicates something that must be fixed before the code can be compiled. All
these errors are detected by compiler and thus are known as compile-time errors.
Most frequent syntax errors are:
Missing Parenthesis (})
Printing the value of variable without declaring it
Missing semicolon
Incorrect format in selection and loop statement
Unmatched parenthesis, square brackets and curly braces
// syntax error
#include<stdio.h>
void main()
{
int x = 10;
int y = 15 // missing semicolon
printf("%d", (x, y));
}
Runtime error
Run Time errors are generated when the program is running and leads to the abnormal behavior or
termination of the program. The general cause of Run time errors is because your program is trying
to perform an operation that is impossible to carry out.
Example: Dividing any number by zero, accessing any file that doesn't exist etc. are common
examples of such error. These types of error are hard to find as the compiler doesn’t point to the
line at which the error occurs.
#include<stdio.h>
void main()
int n = 9, div = 0;
// wrong logic
div = n/0;
13
C Programming BCA-TU [email protected]
Linker Error
Linker error are generated when the linker encounters what looks like a function call; but it cannot
find a function with that name. This is usually caused by misspelling a C standard function (like
main) or not including the header file for the function. These are errors generated when the
executable of the program cannot be generated. This may be due to wrong function prototyping,
incorrect header files.
Missing a C standard main function
Not including a header file for a function.
#include<stdio.h>
int a = 10;
printf("%d", a);
Logical Error
Logical error will cause your program to perform undesired operations which you didn't intended
your program to perform. These errors occur generally due to improper logic used in program.
These types of errors are difficult to debug. These are one of the most common errors done by
beginners of programming. These errors solely depend on the logical thinking of the programmer
and are easy to detect if we follow the line of execution and determine why the program takes that
path of execution.
Example: Multiplying an uninitialized integer value with some other value will result in undesired
output.
#include<stdio.h>
int main()
{
int i = 0;
for(i = 0; i < 3; i++); // logical error : a semicolon after loop
{
printf("loop ");
continue;
}
getchar();
return 0;
}
14
C Programming BCA-TU [email protected]
Semantic Errors
This error occurs when the statements written in the program are not meaningful to the compiler.
#include<stdio.h>
void main()
int a, b, c;
a + b = c; //semantic error
Software:
Software is a set of instructions, data or programs used to operate computers and execute specific
tasks. Software comprises the entire set of programs, procedures, and routines associated with the
operation of a computer system. A set of instructions that directs a computer’s hardware to perform
a task is called a program, or software program.
Software development model
Software development model is process of constructing the software depending upon the situation.
A software development process is the process of dividing software development work into
different phases to improve design, product quality, and project management.
Waterfall Model
The Waterfall Model was 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 fully before the next phase can begin.
This type of software development model is basically used for the project which is small
and there are no uncertain requirements.
At the end of each phase, a review takes place to determine if the project is on the right
path and whether or not to continue or discard the project.
In this model software testing starts only after the development is complete. In waterfall
model phases do not overlap.
15
C Programming BCA-TU [email protected]
Once an application is in the testing stage, it is very difficult to go back and change
something that was not well-thought out in the concept stage.
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.
16
C Programming BCA-TU [email protected]
This model is used only when the requirements are very well known, clear and fixed.
Product definition is stable.
Technology is understood.
There are no ambiguous requirements.
Ample resources with required expertise are available freely.
The project is short.
Incremental Model
In incremental model the whole requirement is divided into various builds.
Multiple development cycles take place here, making the life cycle a “multi-waterfall”
cycle.
Cycles are divided up into smaller, more easily managed modules.
In this model, each module passes through the requirements, design, implementation
and testing phases.
A working version of software is produced during the first module, so you have working
software early on during the software life cycle.
Each subsequent release of the module adds function to the previous release. The process
continues till the complete system is achieved.
17
C Programming BCA-TU [email protected]
18
C Programming BCA-TU [email protected]
19
C Programming BCA-TU [email protected]
20
C Programming BCA-TU [email protected]
21
C Programming BCA-TU [email protected]
22
C Programming BCA-TU [email protected]
V-model
V- Model means Verification and Validation model. Just like the waterfall model, the V-
Shaped life cycle is a sequential path of execution of processes. Each phase must be
completed before the next phase begins.
Testing of the product is planned in parallel with a corresponding phase of development
in V-model.
It is an extension of the waterfall model, Instead of moving down in a linear way, the
process steps are bent upwards after the implementation and coding phase, to form the
typical V shape.
The major difference between the V-shaped model and waterfall model is the early test
planning in the V-shaped model.
Fig: V-Model
Advantages of V-model:
Simple and easy to use.
Testing activities like planning, test designing happens well before coding. This saves a lot
of time. Hence higher chance of success over the waterfall model.
Proactive defect tracking – that is defects are found at early stage.
Avoids the downward flow of the defects.
Works well for small projects where requirements are easily understood.
Disadvantages of V-model:
Very rigid and least flexible.
Software is developed during the implementation phase, so no early prototypes of the
software are produced.
If any changes happen in midway, then the test documents along with requirement
documents has to be updated.
23
C Programming BCA-TU [email protected]
24
C Programming BCA-TU [email protected]
When we want to develop a program using any programming language, we follow a sequence of
steps. These steps are called phases in program development. The program development life cycle
is a set of steps or phases that are used to develop a program in any programming language.
Generally, the program development life cycle contains 6 phases.
Problem Definition
Problem Analysis
Algorithm Development
Coding & Documentation
Testing & Debugging
Maintenance
25
C Programming BCA-TU [email protected]
26
C Programming BCA-TU [email protected]
This phase uses a programming language to write or implement the actual programming
instructions for the steps defined in the previous phase. In this phase, we construct the actual
program. That means we write the program to solve the given problem using programming
languages like C, C++, Java, etc.
Testing & Debugging
During this phase, we check whether the code written in the previous step is solving the specified
problem or not. That means we test the program whether it is solving the problem for various input
data values or not. We also test whether it is providing the desired output or not.
Maintenance
During this phase, the program is actively used by the users. If any enhancements found in this
phase, all the phases are to be repeated to make the enhancements. That means in this phase, the
solution (program) is used by the end-user. If the user encounters any problem or wants any
enhancement, then we need to repeat all the phases from the starting, so that the encountered
problem is solved or enhancement is added.
Programming Paradigms
27
C Programming BCA-TU [email protected]
This paradigm emphasizes on procedure in terms of under lying machine model. There is no
difference in between procedural and imperative approach. It has the ability to reuse the code and
it was boon at that time when it was in use because of its reusability.
Examples of Procedural programming paradigm:
C : developed by Dennis Ritchie and Ken Thompson
C++ : developed by Bjarne Stroustrup
Java : developed by James Gosling at Sun Microsystems
ColdFusion : developed by J J Allaire
Pascal : developed by Niklaus Wirth
Object oriented programming
The program is written as a collection of classes and object which are meant for communication.
The smallest and basic entity is object and all kind of computation is performed on the objects
only. More emphasis is on data rather procedure. It can handle almost all kind of real life problems
which are today in scenario.
28
C Programming BCA-TU [email protected]
Advantages:
Data security
Inheritance
Code reusability
Flexible and abstraction is also present
Examples of Object Oriented programming paradigm:
Simula : first OOP language
Java : developed by James Gosling at Sun Microsystems
C++ : developed by Bjarne Stroustrup
Objective-C : designed by Brad Cox
Visual Basic .NET : developed by Microsoft
Python : developed by Guido van Rossum
Ruby : developed by Yukihiro Matsumoto
Smalltalk : developed by Alan Kay, Dan Ingalls, Adele Goldberg
Parallel processing is the processing of program instructions by dividing them among multiple
processors. A parallel processing system possess many numbers of processor with the objective
of running a program in less time by dividing them. This approach seems to be like divide and
conquer. Examples are NESL (one of the oldest one) and C/C++ also supports because of some
library function.
29
C Programming BCA-TU [email protected]
In normal programming languages, such concept of knowledge base is not available but
while using the concept of artificial intelligence, machine learning we have some models
like Perception model which is using the same mechanism.
In logical programming the main emphasize is on knowledge base and the problem. The
execution of the program is very much like proof of mathematical statement, e.g., Prolog
Software analysis and design includes all activities, which help the transformation of requirement
specification into implementation. Requirement specifications specify all functional and non-
30
C Programming BCA-TU [email protected]
functional expectations from the software. These requirement specifications come in the shape of
human readable and understandable documents, to which a computer has nothing to do.
Software analysis and design is the intermediate stage, which helps human-readable requirements
to be transformed into actual code.
System design tools are shapes, symbols, tables or human readable and understandable documents
which represent flow of system, components of system, conditions and actions to be taken while
implementing into the code.
It is the intermediate stage, which helps human-readable requirements to be transformed into actual
code and can be used to various types computer software to design.
Let us see system design tools used by software designers:
Data flow diagram
ER diagram (Entity Relationship)
Data Dictionary
Pseudocode
Algorithm
Flowchart
Decision table
Entities - Entities are source and destination of information data. Entities are represented
by a rectangles with their respective names.
Process - Activities and action taken on the data are represented by Circle or Round-edged
rectangles.
31
C Programming BCA-TU [email protected]
Data Storage - There are two variants of data storage - it can either be represented as a
rectangle with absence of both smaller sides or as an open-sided rectangle with only one
side missing.
Data Flow - Movement of data is shown by pointed arrows. Data movement is shown from
the base of arrow as its source towards head of the arrow as destination.
Entity-Relationship Model
Entity-Relationship model is a type of database model based on the notion of real world entities
and relationship among them. We can map real world scenario onto ER database model. ER Model
creates a set of entities with their attributes, a set of constraints and relation among them.
ER Model is best used for the conceptual design of database. ER Model can be represented as
follows:
Entity - An entity in ER Model is a real world being, which has some properties
called attributes. Every attribute is defined by its corresponding set of values,
called domain.
For example, consider a school database. Here, a student is an entity. Student has various
attributes like name, id, age and class etc.
o one to one
o one to many
o many to one
o many to many
Data Dictionary
Data dictionary is the centralized collection of information about data. It stores meaning and
origin of data, its relationship with other data, data format for usage etc. Data dictionary has
rigorous definitions of all names in order to facilitate user and software designers.
32
C Programming BCA-TU [email protected]
Data dictionary is often referenced as meta-data (data about data) repository. It is created along
with DFD (Data Flow Diagram) model of software program and is expected to be updated
whenever DFD is changed or updated.
Pseudo-Code
Pseudocode is an artificial and informal language that helps programmers develop algorithms.
Pseudocode is a "text-based" detail (algorithmic) design tool.
The rules of Pseudocode are reasonably straightforward. All statements showing "dependency"
are to be indented. These include while, do, for, if, switch. Examples below will illustrate this
notion.
Examples:
Print "passed"
Else
Print "failed"
Algorithm
33
C Programming BCA-TU [email protected]
Step 1: Start
Step 4: Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 6: Stop
Write an algorithm to find the largest among three different numbers entered by the user.
Step 1: Start
Step 4: If a > b
If a > c
Else
Else
If b > c
34
C Programming BCA-TU [email protected]
Else
Step 5: Stop
Flowchart
Definition of Flowchart
A flowchart is the graphical or pictorial representation of an algorithm with the help of different symbols,
shapes, and arrows to demonstrate a process or a program. With algorithms, we can easily understand a
program. The main purpose of using a flowchart is to analyze different methods. Several standard symbols
are applied in a flowchart:
Input / Output
Process / Instruction
Decision
Connector / Arrow
35
C Programming BCA-TU [email protected]
The symbols above represent different parts of a flowchart. The process in a flowchart can be expressed
through boxes and arrows with different sizes and colors. In a flowchart, we can easily highlight certain
elements and the relationships between each part.
Example: Draw a flowchart to input two numbers from the user and display the largest among two numbers
36
C Programming BCA-TU [email protected]
6. Algorithm does not follow any rules. Flowchart follows rules to be constructed.
Algorithm is the pseudo code for the Flowchart is just graphical representation of that
7. program. logic.
37