0% found this document useful (0 votes)
6 views10 pages

Programming Language

The document provides an overview of programming languages, categorizing them into low-level and high-level types, and explaining their characteristics and uses. It discusses language translators, software types, programming language generations, and the software development process, including problem analysis, design, coding, and testing. Additionally, it covers concepts like algorithms, flowcharts, and common errors in programming.

Uploaded by

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

Programming Language

The document provides an overview of programming languages, categorizing them into low-level and high-level types, and explaining their characteristics and uses. It discusses language translators, software types, programming language generations, and the software development process, including problem analysis, design, coding, and testing. Additionally, it covers concepts like algorithms, flowcharts, and common errors in programming.

Uploaded by

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

Unit-1 Introduction to Programming Language

Programming Language
A programming language is a computer language that is used by programmers (developers) to communicate with
computers. A program is a set of instructions written in any specific language (C, C++, Java, Python, etc.) to perform
a specific task. A programming language is mainly used to develop desktop applications, websites, and mobile
applications. There are many different programming languages, each with its own syntax, structure, and set of
commands. for examples C, C++, Java, Python, C#, etc.

Low-level programming language


A low-level language, often known as a computer's native language. Low-level language is machine-dependent
programming language. The processor runs low- level programs directly without the need of a compiler or
interpreter, so the programs written in low-level language can be run very fast. Low-level language is further
divided into two parts -
i. Machine Language
Machine language is a type of low-level programming language. It is also called as machine code or object code.
Machine language is easier to read because it is normally displayed in binary (i.e. 0 &1) form. It does not require a
translator to convert the programs because computers directly understand the machine language programs. The
advantage of machine language is that it helps the programmer to execute the programs faster than the high-level
programming language.
ii. Assembly Language
Assembly language is also a type of low-level programming language that is designed for specific processors. It
represents the set of instructions in a symbolic and human-understandable form. It uses an assembler to
convert the assembly language to machine language. The advantage of assembly language is that it requires less
memory and less execution time to execute a program. For eg: ADD, SUB, CMP, LDA, etc. are the mnemonics of
assembly language.
2. High-level programming language
High-level programming language is designed for developing user-friendly software programs and websites. This
programming language requires a compiler or interpreter to translate the program into machine language. The
main advantage of a high-level language is that it is easy to read, write, and maintain. High-level programming
language includes C, C++, Python, Java, JavaScript, PHP, etc.
Difference between high level & low level programming language
High-Level Language Low-Level Language

It is user-friendly programming language. It is machine- friendly programming


language.

It is simple to understand. It's difficult to understand.


It is easy to debug. It is complex to debug.
High-level language is portable. Low-level language is non-portable.
It is compatible with all operating systems. It is entirely dependent on the machine.
For translation, a compiler or interpreter is For translation, it will need an assembler.
required.

It is commonly used in programming. It is no longer widely used in programming.

Language translator
A language translator is a language processor that converts a computer program from one language to machine
language. It translates a high-level language program into a machine language program that the central processing
unit (CPU) can understand. It takes a program written in source code and converts it into machine code. It
discovers and identifies the error during translation. There are 3 different types of translators:

a. Assembler:
Assembler is the language translator designed to translate assembly language program (source codes)
into machine language program (object codes). The original assembly language program codes are
called source codes and after translation, the final machine language program codes are called object codes.

b. Compiler:
A compiler is a language translator that translates high-level language program to machine language
program all at once. While translating, it checks the syntax (grammar of the source code) and translates it
into object code at a single attempt. If any error is found, the compiler produces syntax errors and causes of
the errors. The source code file must be syntax error-free for complete compilation process.

c. Interpreter:
The interpreter is the language translator designed to translate high-level language program into machine
language program, line-by-line or one instruction at a time. Unlike the compiler, it translates and executes
one statement at a time before moving to another. If any error is encountered, the translation is halted and
an error message is displayed.
Software
Software is a set of programs that enables the hardware to perform a specific task. Software is responsible for
directing all computer-related devices and instructing them regarding what and how the task is to be performed.
Software is a computer program that provides a set of instructions to execute a user’s commands and tell the
computer what to do. All the programs that run the computer are software. Software's are broadly classified into
two types.

1. System Software
2. Application Software

1. System Software
System software is a computer program that helps the user to run computer hardware or software and
manages the interaction between them. Essentially, it is software that constantly runs in the computer
background, maintaining the computer hardware and computer's basic functionalities, including the
operating system, utility software, and interface.
i. Operating System
The operating system acts as an interface between the user and system hardware. It is a group of
software that handles the execution of programs and offers general services for the application that
runs over the computer. It is the first thing that gets loaded in the system's memory wherever you turn on
your computer. For example: Windows Operating System, Apple's Mac OS, Apple's IOS, Android,
Linux, UNIX, etc.
ii. Language Translator
A language translator is a language processor that translates a high-level language program into a
machine language program. It takes a program written in source code and converts it into machine
code. For example, Compiler, Interpreter & Assembler.
iii. Device Drivers
The device driver is a type of software that operates or controls some specific hardware devices
linked to the computer system. They provide a software interface to hardware devices allowing
computer operating systems and other applications. Some common examples of such device drivers
that connect hardware devices to a system easily. For example; USB (Universal Serial Bus) Drivers,
Printer Drivers, Sound Card Driver, Network driver, etc.

iv. Utility Software


Utility Software is system software that helps to maintain the proper and smooth functioning of a
Computer System. It assists the Operating System to manage, organize, maintain, and optimize the
functioning of the computer system. Utility Software performs certain tasks like virus detection,
installation, and uninstallation, data backup, deletion of unwanted files, etc. Some examples are
antivirus software, compression tools (Win rar), disk management tools, network utilities, etc.

2. Application Software
Application software is a set of programs designed to perform a specific task. It does not control
the working of a computer as it is designed for end-users. A computer can run without application
software. Application software can be easily installed or uninstalled as required. It can be a single
program or a collection of small programs. It is a product or a program that is designed only to
fulfill end-users’ requirements. There are two types of application software:
Packaged Software: This type of application software is used for a variety of tasks and it is not
limited to performing a specific task only. For example, MS-Word, MS-Excel, Adobe Photoshop,
PowerPoint, etc.

Customized Software: This type of application software is used or designed to perform specific
tasks or functions or designed for specific organizations. For example, Bill processing System,
Result Processing System. Accounting Management System, etc.

Generations of programming language


Programming languages have been developed over the year in a phased manner. Each phase of
developed has made the programming language more user-friendly, easier to use and more
powerful. Each phase of improved made in the development of the programming languages can be
referred to as a generation. The programming language in terms of their performance reliability
and robustness can be grouped into five different generations,

1. First generation languages (1GL)


2. Second generation languages (2GL)
3. Third generation languages (3GL)
4. Fourth generation languages (4GL)
5. Fifth generation languages (5GL)
1. First Generation Language (Machine language)
The first generation programming language is also called machine language because they were
used to program the computer system at the machine level. The machine language also referred to
as the native language of the computer system. In the machine language, a programmer only deals
with a binary digits (i.e. 0 & 1)

2. Second Generation language (Assembly Language)


The second generation programming language also belongs to the category of low-level-
programming language. The second generation language comprises assembly languages that use
the concept of mnemonics for the writing program. In the assembly language, symbolic names are
used to represent the opcode and the operand part of the instruction.

3. Third Generation languages (High-Level Languages)


The third generation programming languages were designed to overcome the various limitations
of the first and second generation programming languages. The languages of the third and later
generation are considered as a high-level language because they enable the programmer to
concentrate only on the logic without considering the internal architecture of the computer
system. For example, C, C++, Java, Visual Basic, etc.

4. Fourth generation language (Very High-level Languages)


The languages of this generation were considered as very high-level programming languages.
Fourth generation languages are commonly used in database programming and scripts. For
example: PHP, Python, SQL, etc.

5. Fifth generation language (Artificial Intelligence Language)


The programming languages of this generation are used to make computer smarter. The major
fields in which the fifth generation programming language employed are Artificial Intelligence.
Examples: mercury, prolog, Lojban, etc.

Structured Programming language


Structured programming is a programming paradigm/model aimed at improving the clarity,
quality, and development time of a computer program by making extensive use of the structured
control flow(if/else) and looping statements. In structured programming, we sub-divide the whole
program into small modules so that the program becomes easy to understand. It is also known as
modular programming. In this approach, a large problem is break down into small problem and
work on each piece separately. For examples: C, Java, Python, etc.

Advantages
1. Easier to read and understand
2. User Friendly
3. Easier to Maintain
4. Mainly problem based instead of being machine based
5. Development is easier as it requires less effort and time
6. Easier to Debug
7. Machine-Independent.

Disadvantages
1. It takes time to convert into machine code.
2. Lack of encapsulation, so lack of data security.
3. The program depends upon changeable factors like data-types. Therefore it needs to be updated.
4. Excessive nesting of loops and conditionals can make the code harder to read and understand.
Source code
Source code is generally a programming statements that is created by a programmer. It is written by using any of
the programming language. It needs to be translated using translator. It is a code which is easily readable by
humans.

Object Code
Object code is a code produced by a compiler. The final step of producing executable program is to transform
object code into machine language, if it is not already in this form. A program linker is used to perform this job.
What is a compilation?
The compilation is a process of converting the source code into object code. It is done with the help of the compiler.
The compiler checks the source code for the syntax errors, and if the source code is error-free, then it generates the
object code.

Syntax errors:
These are the type of errors that occur when code violates the rules of the programming language such as missing
semicolons, brackets, or wrong indentation of the code.
Logical errors:
These are the type of errors that occurs when incorrect logic is implemented in the code and the code produces
unexpected output.
Runtime errors:
Runtime errors are those that happen during program execution (run-time) after successful compilation. Division
by zero error, also known as Division error, is a common run-time error.
Semantic Error
Semantic errors are errors that occur when the code written by the programmer makes no sense to the compiler,
even though it is syntactically correct. They are different from syntax errors, which indicate errors in the structure
of the program, as semantic errors are related to the meaning and implementation of the program.
For example,
 Using a string instead of an integer or accessing an array index that is out of bounds can cause semantic
errors.
 Uninitialized variables and type incompatibility are other common types of semantic errors.

Algorithm: An algorithm is an effective step-by-step procedure for solving a problem in a finite number of steps
in order to perform particular task. An algorithm itself is division of a problem into small steps which are ordered
in sequence and easily understandable. An algorithm is a set of commands that must be followed for a
computer to perform calculations or other problem-solving operations.

Flowchart: Flowchart is a graphical representation that explains the sequence of operations to be performed in
order to solve a problem. To express different operations in the flowchart various standard symbols are used. All
symbols are connected among themselves in order to show the flow of information and processing. The symbols
used in flowchart are explained below:

Problem Solving using Computer


Computer based problem solving is a systematic process of designing, implementing and using programming tools
during the problem solving stage. This method enables the computer system to be more intuitive with human logic
than machine logic. Final outcome of this process is software tools which is dedicated to solve the problem.
Software development is the process of creating such software, which satisfies end user’s requirements and needs.

1. Problem analysis
Problem analysis is the process of defining a problem and decomposing overall system into smaller parts to
identify possible inputs, processes and outputs associated with the problem. Problem analysis is also known as
defining problem, which involves the following six tasks.
 Specifying the Objective
First, we need to know what problem is actually being solved. Making a clear statement of the problem
depends upon the size and complexity of the problem.
 Specifying the Output
Before identifying inputs required for the system, we need to identify what comes out of the system. The
best way to specify output is to prepare some output forms and required format for displaying result.
 Specifying Input Requirements
After having specified the outputs, the input and data required for the system need to be specified as well.
 Evaluating the Feasibility :
After the successful completion of all the above four steps one needs to see whether the things
accomplished so far in the process of problem solving are practical and feasible. To replace an existing
system one needs to determine how the potential improvements can be done over existing system or other
similar system.
.
 Problem Analysis Documentation
This document should contain statements on the program’s objectives, output specifications, input
requirements, processing requirements and feasibility.

2. Program design
The second stage in software development or problem solving using computer cycle is program design. This
stage consists of preparing algorithms and flowcharts. Generally, this stage intends to make the program more
user friendly, feasible and optimized. Algorithm and flowchart are the tools to design the planned problem.

Algorithm: An algorithm is an effective step-by-step procedure for solving a problem in a finite number of steps
in order to perform particular task. An algorithm itself is division of a problem into small steps which are ordered
in sequence and easily understandable. An algorithm is a set of commands that must be followed for a
computer to perform calculations or other problem-solving operations.

Flowchart: Flowchart is a graphical representation that explains the sequence of operations to be performed in
order to solve a problem. To express different operations in the flowchart various standard symbols are used. All
symbols are connected among themselves in order to show the flow of information and processing. The symbols
used in flowchart are explained below:
3. Coding
In this stage, process of writing actual program takes place. A coded program is most popularly referred to
as a source code. The coding process is done using any of the languages (low-level or high level language).
The actual use of computer takes place in this stage in which the programmer writes a sequence of
instructions ready for execution. Coding is also known as programming.

Compilation and Execution


Compiling involves translating source code into machine code. Debugging focuses on finding and fixing
errors in the code. Executing involves running the compiled machine code on the computer's processor.
Running encompasses the entire process of preparing, executing, and interacting with a software program.
4. Testing and Debugging
Testing is performed to verify that whether the completed software package functions or works according
to the expectations defined by the requirements. Testing is generally performed by testing team which
repetitively executes program with intent to find error. After testing, list of errors and related information
is sent to program developer or development team.
The types of testing to do in this phase:
 Performance testing: Assesses the software's speed and scalability under different conditions
 Functional testing: Verifies that the software meets the requirements
 Security testing: Identifies potential vulnerabilities and weaknesses
 Unit-testing: Tests individual units or components of the software
 Usability testing: Evaluates the software's user interface and overall user experience
 Acceptance testing: Also termed end-user testing, beta testing, application testing, or field testing, this is
the final testing stage to test if the software product delivers on what it promises
Debugging is the process of finding errors and removing them from a computer program, otherwise they
will lead to failure of the program. Even after taking full care during program design and coding, some
errors may remain in the program and these errors appear during compilation or execution. Debugging is
generally done by program developer.

5. Implementation, Evaluation and maintenance


The objective of the Implementation Phase is: first to install the software in the production environment
and to bring it into operation; and second, to ensure that the software, as developed:

 Satisfies the functional requirements


 Satisfies the business needs;
 Operates as described in the User and Operator Manuals

Evaluation identifies whether the system meets the initial requirements and objectives. This is when the
system is evaluated for weaknesses. The objective of the evaluation phase of the systems development life
cycle is to deploy the system and train the system end users.

In the maintenance stage, users may find bugs and errors that were missed in the earlier testing phase.
These bugs need to be fixed for better user experience. In some cases, these can lead to going back to the
first step of the software development life cycle.
6. Program documentation
The program documentation is the process of collecting information about the program. The
documentation process starts from the problem analysis phase to debugging and testing. Documentation
consists two types of documentation, they are:

 Programmer's Documentation
Programmer’s documentation contains all the technical details. Without proper documentation it is
very difficult even for the original programmer to update and maintain the program. A programmer’s
documentation contains the necessary information that a programmer requires to update and
maintain the program.
 User's Documentation
User documentation is required for the end user who installs and uses the program. It consists
instructions for installation of the program and user manual.

History of C
C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American
Telephone & Telegraph), located in the U.S.A. Dennis Ritchie is known as the founder of the c
language. It was developed to overcome the problems of previous languages such as B, BCPL, etc. C
language was developed to be used in UNIX operating system. It inherits many features of previous
languages such as B and BCPL. C supports a wide variety of built-in functions, standard libraries and
header files.

Features of C Programming Language


 Robust Language: C is a robust language in the sense that it has the rich set of library
functions, keywords, data types, etc.
 Machine Independent or Portable: C programs can be executed on different machines. Therefore,
C is a machine independent language.
 Code reusability: C programming supports inbuilt and user defined functions. So, it provides code
reusability.
 Structured programming language: C is a structured programming language in the sense that we can
break the program into parts using functions. So, it is easy to understand and modify.
 Rich Library: C provides a lot of inbuilt functions that make the development fast.
 Memory Management: It supports the feature of dynamic memory allocation. We can allocate and de-
allocate the memory at runtime.
 Pointer: C provides the feature of pointers. We can directly interact with the memory by using the
pointers. We can use pointers for memory, structures, functions, array, etc.

You might also like