0% found this document useful (0 votes)
60 views39 pages

20cs204 Class 1 Pp-II

Uploaded by

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

20cs204 Class 1 Pp-II

Uploaded by

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

SRI RAMAKRISHNA ENGINEERING COLLEGE

VATTAMALAIPALAYAM, N.G.G.O. COLONY POST,


COIMBATORE – 641 022

20CS204
Programming Paradigms - II

CLASS I
Date:28.07.2021
G.NARENDRAN
ASSISTANT PROFESSOR ,Dept of CSE
Teaching Experience : 6.6 Years in SREC
I have completed my Post Graduation in M.E (CSE) from
About Me Government College Technology in 2014 and Under graduation in
B.E (CSE) from Gnanamani College of Technology. I have
completed Three Consultancy Projects Craftsman Automation
Pvt, Ltd with 5.85 Lakhs, SNR Trust with 1 Lakh, Inovark
Technology with 83 Thousand and Two Ongoing Projects with
Roots Industries, L & T Technology. I have Filed Patent No.
201941006006 in the name of “Trolley Tracking using Wi-Fi”.
Mail id: [email protected]
Ph.no: 9629623920
COURSE OUTCOMES
On successful completion of the course, students will be able to

CO1 Relate the basic constructs in C++ and Java programming.

CO2 Demonstrate OOP concepts with simple programs.

CO3 Develop simple applications in Java.

CO4 Analyze the real-life problem scenarios with object-oriented concepts


SYLLABUS
MODULE I Overview of OOPS Concepts

MODULE II BASICS OF JAVA

MODULE III OOP concepts in Java

Exception Handling, Multithreading, File


MODULE IV handling in Java
GUI programming, JDBC, Collections
MODULE V framework, Wrapper class
Overview of OOPS Concepts 7
MODULE I

Structure of C++ program – Operator overloading – Functions: Virtual


Function, Friend function, Static function - Templates.

JAVA 8
Features of Java – Comparison of C, C++ with Java - Java Architecture- JDK,
MODULE II

JRE, JVM - Keywords and Operators – Control statements - Java Array –


Unicode System – String and StringBuffer.
OOP concepts in Java 10
MODULE III

OOP concepts - Class and Objects - Method, Constructors - this, static -


instanceof Operator - Inheritance vs Aggregation - super – final -
Polymorphism: Method overloading, overriding – Abstraction: Abstract class,
Interface – Encapsulation: Package, Access modifiers.

Exception Handling, Multithreading, File handling in Java 13


Exception Handling: Exception types - Try and Catch Block - Finally block –
MODULE IV

Throw, Throws, finally clause – User defined Exception – Multithreading:


Basics of a thread - Life cycle of a thread– Creating and Running a Thread ––
Thread control and priority – Synchronization and Inter-Thread
Communication - File handling and IO Streams.

Total Periods: 45
GUI programming, JDBC, Collections framework, Wrapper class 10
MODULE V

GUI: Overview of Applet, Swing, AWT, Event Handling - JDBC: Introduction -


JDBC Drivers – Establishing connection – Statements - Collection Framework:
Introduction – List: Types, Iterators – Generics – Set – Map: Types - Wrapper
classes.

Total Periods: 45
REFERENCES
TEXT BOOKS
1. Herbert Schildt, “C++: The Complete Reference”, 5th Edition, Tata McGraw-Hill,2012.
2. Herbert Schildt, “The Complete Reference Java”, 9th Edition, Tata McGraw-Hill, 2016.

REFERENCES
1. E. Balaguruswamy, “Object Oriented Programming with C++”, 6th Edition, Tata McGraw-Hill,
2013
2. E. Balaguruswamy, “Programming with Java”, 4thEdition, Tata McGraw-Hill, 2007
3. Deitel H M and Deitel P J, “JAVA - How to Program”, 7thEdition, Prentice Hall of India / Pearson
Education, 2007.
4. Steven Holzner et al, “Java 2 Programming”, Dream Tech Press, 2009.
5. Bernard Van Haecke, “JDBC 3 Java Database Connectivity”, Wiley-DreamTech Press India Pvt.
Ltd., Edition, 2002.
Type of Programming
C is a procedural language in which the program revolves around
the functions. The entire problem is broken down into numerous
functions. The main focus of the program is on functions or
procedures to get the things done.

C++, on the contrary, is an object-oriented programming language.


Here the data of the problem is the main focus and the classes are
built around this data. Functions operate on the data and closely
bound to data.
Programming Approach
As C is a procedural language, it follows a top-down approach of
programming. Here we take the problem and then break it into
subproblems until we find single subproblems that can be solved
directly. Then we combine the solutions to get the main solution.

C++ follows a bottom-up approach to programming. In this, we


start with low-level design or coding and then build on this low-
level design to get a high-level solution.
Application Development
C language is helpful in the programming of embedded
systems or low-level implementations.

C++, on the other hand, is more suitable for server-side


applications, network applications or for applications like
gaming, etc.
File Extension

The programs written in C are usually saved with “.c”


extension.

The C++ programs are saved with the “.cpp” extension.


Compatibility With Each Other
C++ is a subset of C as it is developed and takes most of its
procedural constructs from the C language. Thus any C program
will compile and run fine with the C++ compiler.

However, C language does not support object-oriented features of


C++ and hence it is not compatible with C++ programs. Therefore
programs written in C++ will not run on C compilers.

C++ language is generally compatible with other generic


programming languages but C language is not
Data Security
In C, the main emphasis is on functions or procedures rather than
on data. Hence as far as data security is concerned, it is negligible
in C.

In C++, as we are dealing with classes and objects, the main


building block of the program is Data. Thus, data is tightly secured
using classes, access specifiers, encapsulation, etc.
Program Division
A program in C is divided into functions and modules. These
functions and modules are then called by the main function or
other functions for execution.

A C++ program is divided into classes and objects. The problem is


designed into classes and the objects of these classes are the
executing units that are created by the main functions and are
executed.
Standard I/O Operations
The standard input-output operations in C to read/write data
from/to the standard device are ‘scanf’ and ‘printf’ respectively.

In C++, the data is read from the standard input device using
‘cin’ while it is printed to the output device using ‘cout’.
Structures
Structures in C and C++ use the same concept. But the
difference is, in C, as we cannot include functions as
members.

C++ allows structures to have functions as its members.


Inline Function
Inline functions are not supported in C. C usually works with
macros to speed up the execution.

In C++ on the other hand, inline functions, as well as macros,


are used.
Function Overloading
Function overloading is the ability to have more than one
function with the same name but different parameters or a list
of parameters or order of parameters.

This is an important feature of object-oriented programming and


is present in C++. However, C does not support this feature.
Memory Management
Both C and C++ have manual memory management but how
memory management is done is different in both languages.

In C we use functions like malloc (), calloc (), realloc (), etc.,
to allocate memory and free () function to free the memory.
But, in C++, we use new () and delete () operators to allocate
and deallocate the memory respectively.
Tabular format C vs C++
Tabular format C vs C++
Tabular format C vs C++
Tabular format C vs C++
History of C++ programming

Bjarne Stroustrup
Timeline of C++
History of C++
The C++ language is an object-oriented programming
language & is a combination of both low-level & high-level
language – a Middle-Level Language.
C++ was initially known as “C with classes was renamed C++ in
1983.
++ is shorthand for adding one to variety in programming;
therefore C++ roughly means that “one higher than C.”
What is OOP?
OOP stands for Object-Oriented Programming.

Procedural programming (C) is about writing procedures or


functions that perform operations on the data, while object-
oriented programming is about creating objects that contain
both data and functions.
What is OOPS Concept
OBJECT ORIENTED PROGRAMMING (OOP) is a programming concept
that works on the principles of abstraction, encapsulation,
inheritance, and polymorphism.

It allows users to create the objects that they want and then,
create methods to handle those objects. The basic concept of OOPs
is to create objects, re-use them throughout the program, and
manipulate these objects to get results
Core OOPS concepts
What is an Object?

Object is a instance of class, object has state and behaviors


What is Class?

Car, bike, truck these all are belongs to vehicle class. These
Objects have also different states and behaviors. For Example car
has state - color, name, model, speed, Mileage. as we;; as
behaviors - distance travel
Inheritance in C++
The real life example of inheritance is child and parents, all
the properties of father are inherited by his son
Polymorphism
Polymorphism is derived from 2 greek words: poly and morphs. The word
"poly" means many and morphs means forms. So polymorphism means
many forms.
Abstraction
Abstraction is the concept of exposing only the required essential
characteristics and behavior with respect to a context.

Hiding of data is known as data abstraction. In object oriented


programming language this is implemented automatically while writing
the code in the form of class and object.
Encapsulation
Encapsulation is a process of wrapping of data and methods in a single
unit. It is achieved in C++ language by class concept.

Combining of state and behavior in a single container is known as


encapsulation.
Advantage of OOPs Concept
• Data Security
• Reusability of existing code
• Creating new data types
• Abstraction
• Less development time
• Reduce Complexity
• Better Productivity

You might also like