STUDY MODULE FOR
MCQ SESSION 7
PROGRAMMING CONCEPTS
By Tawqeer ul Islam
Please Visit
CA Lateef’s Academy – Educate All Trust
on YouTube for the Videos.
Link: [Link]
LECTURE 7
PROGRAMMING
CONCEPTS
Learning Objectives
• Introduction to Programming.
• Programming Languages.
• Low level, Medium level and High level languages.
• Some Important High Level Languages.
• Language Translators: Compiler, Assembler, Interpreter.
• Generation of Languages.
• Programming errors.
• Terms Related to Programming.
INTRODUCTION TO COMPUTER PROGRAMS
COMPUTER PROGRAMS
• Program can be defined as a set of instructions that need to be executed to accomplish a
computing task.
• A person who writes or performs the program is known as programmer.
• Programming is the process of creating a set of instructions that tell a computer how to
perform a task.
• Programming can be done using a variety of computer programming languages, such as JavaScript,
Python, and C++. .
PROGRAMMING LANGUAGE
PROGRAMMING LANGUAGE
• It is a set of commands, instructions and other syntax use to create a software
program.
• Programming language must be simple, easy to learn and use.
• It must be consistent in terms of syntax and semantics.
Calculator Calculator
Program in Program in
C++ Java
TYPES OF PROGRAMMING LANGUAGES
TYPES OF PROGRAMMING LANGUAGES
TYPES OF PROGRAMMING LANGUAGES
• Programming languages are mainly categorized into three parts which are as follows
I. Low Level Language (LLL): These programming languages are more
difficult to understand.
• It is designed to operate and handle the entire instruction set of a
computer system directly which are generally used to write the system
software. e.g. Machine language and Assembly language.
• Low level language abbreviated as LLL, are languages close to the machine level
instruction set.
• A low-level programming language interacts directly with the registers and
memory.
• Since, instructions written in low level languages are machine dependent.
• Programs developed using low level languages are machine dependent and are not
portable.
A) Machine Language: It is the only language understood by the computers.
• Sometimes, it referred to as machine code or object code or binary
language.
• It is a collection of binary digits (0 or 1) or bits that the computer reads and
interprets.
B) Assembly Language It is a low level programming language which is used
as an interface with computer hardware.
• It uses structured commands as substitutions for numbers, allowing
humans to read the code easier than looking at binary codes.
• It can use mnemonic than numeric operation code, and it also provides the
information of any error in the code.
• This language helps in specifying the symbolic operand that means it does
not need to specify the machine address of that operand.
• The data can be declared by using decimal notation.
II. Medium Level Language (MLL): It serves as the bridge between raw hardware and
programming layer of a computer system.
• It is designed to improve the translated code before it is executed by the processor.
• The improvement process helps to adjust the source code in accordance with the
computational framework of the target machine. e.g. C.
III. High Level Language (HLL): It is an advanced computer programming language
that is not limited to one computer, designed for a specific job and is easier to
understand.
• The main advantage of high level languages over low level languages is that they are easier to
read, write and understand. e.g. Python, BASIC, C, FORTRAN, Java, Pascal, etc.
• High-level languages have the following characteristics:
• Require translation
• Portable
• Easier to read, write and maintain as commands are similar to English.
LANGUAGE TRANSLATORS
LANGUAGE TRANSLATORS
• It is a software which converts programming languages into machine language.
• The translated program is called the object code.
TYPES OF LANGUAGE TRANSLATORS
• Depending upon used programming languages, language translator is divided into three categories which
are as follows
1. Assembler: It converts a program written in assembly language into machine language.
2. Interpreter: It converts a HLL program into machine language by converting it line-by-line.
If there is any error in any line, it stops the execution of the program immediately and
reports to the user at the same time.
Program execution cannot resume until the error is rectified by the user.
This is a slow process and consumes less memory space.
3. Compiler: It converts HLL program into machine language, which can be understood by the
processor.
Compiler converts the entire HLL program in one go and reports all the errors of the
program along with the line numbers.
A compiler creates a unique object program, i.e. if a source program is compiled, there is no
need of that source program because output can be obtained by executing that object program.
SOME HIGH LEVEL LANGUAGES
Python 1991 Guido van Rossum Scientific Compiled and
Interpreted
GENERATION OF LANGUAGES
GENERATION OF LANGUAGES
• The concept of language generations, sometimes called levels, is closely connected to the
advances in technology that brought about computer generations.
• The five generations of language are as Follows
(i) The first generation languages or 1 GLs are low level languages like machine language.
(ii) The second generation languages or 2GL are also low level languages that generally
consist of assembly language.
(iii) The third generation languages or 3GLs are high level languages such as C, C++, Java.
(iv) The fourth generation languages or 4GLs are the languages that consist of statements
similar to the statements of human language.
4GLs are commonly used in database programming and scripting programming, e.g SQL, VBScript,
python, etc.
(v) The fifth generation languages or 5GLs are programming languages that contain visual
tools, which help to develop a program. A good example of 5GLs is Visual Basic.
PROGRAMMING ERRORS
PROGRAMMING ERRORS
• An error in a program is called bug.
• It is a term used to describe any issue that arises unexpectedly that cause a computers not
function properly.
Types of Errors
• The types of error are classified into four categories which are as follows
1. Syntax Error: When the rules of the programming language are not followed, the
compiler will show syntax error.
2. Semantic Error: Semantic errors are reported by the compiler when the statements written
in the program are not meaningful to the compiler.
PROGRAMMING ERRORS
3. Logical Error Logical errors are those errors that occur in the output of the program.
• The presence of logical errors leads to undesired or incorrect output.
4. Runtime Error Runtime errors are those errors that occur during the execution of a
program.
It generally occurs due to some illegal operation performed in the program.
ALGORITHM
• An algorithm is a step by step method of solving a problem.
• It is commonly used for data processing, calculation and other related computer and
mathematical operations.
• The desirable features of an algorithm are
(i) Each step of algorithm should be simple.
(ii) It must be in a finite number of steps.
(iii) It should be as efficient as possible.
(iv) It should be clear in the sense.
Flowchart for the even odd algorithm
TERMS RELATED TO PROGRAMMING
• Program Documentation: It is a kind of documentation that gives a comprehensive procedural
description of a program/software. It shows as to how software is written.
• The program documentation describes what exactly a program does by mentioning about the
requirements of the input data and effect of performing a programming task.
• OOPs: OOPs stands for Object Oriented Programming in which programs are considered as a
collection of objects.
• De-Bugging: It is the process of locating and fixing or bypassing bugs (errors) in computer
program code.
• Visual Basic: It is an interpreted language.
• Reserved words: These are the words that a programming language has set aside for its own use.
• Pseudocode: It is not a programming language, but simply an informal way of describing a
program. It does not follow any syntax strictly.
• Control structure: It is a statement or block of statements in a programming language that
determined the control flow or sequence of execution of other instructions or statements.
• Looping: It is a control structure which is used in a program to execute a particular set of
statements repeatedly.
I hope you liked the session.
LIKE
SHARE
SUBSCRIBE
Please Visit
CA Lateef’s Academy – Educate All Trust
on YouTube for the Videos.
Link: [Link]