This document provides an overview of object-oriented programming concepts like classes, structures, and the program execution process in C++, Java, and other languages. It begins with definitions of basic terms like data and information. It then covers key OOP concepts like classes and structures in C++, highlighting how classes are more complex and can be inherited while structures are simpler groups of variables. The document also outlines the typical execution flow for C/C++ and Java programs, including details on compilers, linkers, loaders, and JVMs. Sample code examples are provided to illustrate classes and structures.
Introduction to Object Oriented Programming (OOP) Roadmap
1. Object Oriented Programming
Roadmap to Introduction to Object Oriented
Programming
Prepared by,
Mr.S. Ezra Vethamani
Assistant Professor/CSE
SRM Institute of Science and Technology
Ramapuram Campus
Chennai- 600 089
2. BASICS – BEFORE GET INTO OOP.
What is DATA?
Data is any collection of numbers, characters
orother symbols.
Data on its own has no meaning.
Examples: City, Time , Temperature
4. BASICS – BEFORE GET INTO OOP CONT.
What is INFORMATION?
It is only data after processing by a computer and
becomes information.
Example: The morning temperature of the city
Chicago is 62.
What is Program?
Program is a collection of instructions that can be
executed by a computer to perform a specific task.
6. BASICS – BEFORE GET INTO OOP.
#include<stdio.h>
//function to find largest among three number
float large(float a, float b, float c) //
{
if(a>=b && a>=c)
return a;
else if(b>=a && b>=c)
return b;
else
return c;
}
int main()
{
float num1, num2, num3, largest;
printf("Enter three numbers: ");
scanf("%f %f %f", &num1, &num2, &num3);
largest = large(num1, num2, num3);
printf("Largest number = %.2f",largest);
return 0;
}
Output:-
Enter three numbers: 12.5 8 6.9
Largest number = 12.50
Enter three numbers: 3 5.9 6.0
Largest number = 6.00
7. BASICS – BEFORE GET INTO OOP.
What is STRUCTURE?
Structure is a group of variables of different data types
represented by a single name.
Store the data of students like student name, age, address,
id etc. of different types. ( Array not possible)
Example
/* Created a structure here. The name of the structure is *
StudentData. */
struct StudentData
{
char *name;
int id;
int age;
float height;
};
/* student is the variable of
structure StudentData*/
struct StudentData student;
12. C++ CLASS C++ STRUCTURE
CLASS VS. STRUCTURE IN C++ PROGRAM
Extension of Structure
Collections of
variables/data
Members are private
/public/protected
Members are by
default private.
Classes are inherited
Complex programs
Structure is a collection
of variables of different
data types under a single
name.
Collections of
variables/data
Members are private
/public/protected
Members are by default
public.
Not inherited
Simple programs
14. Linker is a system
program that takes one
or more object files and
combines them into a
single executable file,
library file, or another
'object' file.
Loader is the part of an
operating system that
is responsible for
loading programs and
libraries.
C & C++ PROGRAM EXECUTION FLOW