Professional Documents
Culture Documents
Chapter-1
By
Rani Dubey
An Introduction to Programming
(Chapter-1)
• Different Types of programming languages
• Description of compiler and Interpreter
• Object Oriented Programming
• Advantage of Object Oriented Programming
• Features of Object Oriented Programming
Different Types of programming languages
Available (18-08-2020)
• Name?
–C
– C++
– Python
– C Sharp
– Matlab
– Java
– HTML
– Fortran(Formula Translation)
– COBOL (Common Business Oriented Language)
Categorise Programming approaches
• Monolothical programming
– Within one block we complete the code required
• Modular Programming
– Simple
– Efficiency
– Small(managable)
– Rectifying error is easy
– (Dividing the task into subtasks)
– Examples of constructs used in Programming languages
• Subroutine
• Procedure
• function
• Structural Programming
– A modular program with Single entry and single exit point
– C is a structural programming Language
• Object oriented Programming
Description of compiler and
Interpreter (19-08-2020)(Translator)
• Compiler
– Compiler is a computer program that translates
source code from a high-level programming
language to a lower level language to create an
executable program.
– E.g. C, C++, Pascal, Cobol, Fortran etc.
Interpreter
• Interpreter
– An interpreter is a computer program that directly
executes instructions written in a programming
language or scripting language
– Step wise translation and execution of the Source
program
– E.g. Basic, Perl, Python, Matlab
Compiler Vs. Interpreter
Sl. No. Compiler Interpreter
1 Translate High level language program to Translate and execute high level language
Low level Language program program
2 Accepts the program as a whole then Accepts one statement (instruction) at a
translate into one executable file to run time if successful in execution then
accept another
3 Shows all the Errors if any in the program Stop after finding one error, does not
show all the errors
4 Once translated no need for further Each time needs to run the program will
translation can run directly the already be translated and run step by step
translated program
5 Compiler is a big program took more Interpreter occupies less amount of
amount of memory memory
6 Compiler is fast Interpreter is slow
7 Debugging is difficult Debugging is easy
8 Examples are C, C++,Pascal, Cobol Examples are Python, Basic, perl, Matlab
Object Oriented Programming
• Object
– Why
– What
– how
• Oriented
– way of approach
• Programming
– Set/Sequence of instructions
Brief Overview
• Types of Languages
– 1st generation (Binary)
– 2nd generation (Assembly language)
• Instead of using binary codes we write mnemonics(ADD), values(5)
• Translator(Assembler)
• Machine dependent
• Programmer must have the knowledge hard ware
– 3rd generation (High level language) c,…
• Paradigms of programming
• Translators(interpreter and Compiler)
• Why Object Oriented Programming
• The real world behaviour is not reflected
properly
• What is required
• How(emphasize)(stepwise)
Features/Principles of OOP
• Abstraction
• Object
• Class
• Encapsulation
• Polymorphism
• Inheritance
• Data Hiding
Abstraction
Abstraction
• Humans manage complexity through
abstraction
• Dictionary meaning
– the quality of dealing with ideas rather than events.
– freedom from representational qualities in art.
• abstraction is the process of hiding background
details and showing only essential features
pertinent to the application
Object
• Object
– Anything having physical or logical existence may
be referred as an object
• object
– Attributes + Behaviours
– Properties + Behaviour
– Data members + Functions
• Instance of a class
Class
• Blue print, Template
• N no of objects can be created through a class