Professional Documents
Culture Documents
Object Oriented Programming Lab: Gautam Buddha University
Object Oriented Programming Lab: Gautam Buddha University
Object Oriented Programming Lab: Gautam Buddha University
OBJECT ORIENTED
PROGRAMMING LAB
CS285
SUBMITTED BY:
NAME: ARYAN GUPTA
ROLL NO: 20/BCS/014
SUBMITTED TO:
MR. ABHISHEK KUMAR
2
INDEX
EXPERIMENT- 01
OBJECTIVE:
Write a program to demonstrate the Constructor Overloading, assume desired
parameters.
PROGRAM CODE:
OUTPUT:
4
EXPERIMENT- 02
OBJECTIVE:
Write a program demonstrating the public, protected and private parameters.
PROGRAM CODE:
OUTPUT:
5
EXPERIMENT- 03
OBJECTIVE:
Write a program to demonstrate constructor with default argument.
PROGRAM CODE:
OUTPUT:
6
EXPERIMENT- 04
OBJECTIVE:
Write a program to demonstrate destructor in inheritance.
PROGRAM CODE:
OUTPUT:
7
EXPERIMENT- 05
OBJECTIVE:
Write a program to demonstrate multiple inheritances.
PROGRAM CODE:
8
OUTPUT:
9
EXPERIMENT- 06
OBJECTIVE:
Write a program to demonstrate constructor call in the derived class.
PROGRAM CODE:
OUTPUT:
10
EXPERIMENT- 07
OBJECTIVE:
Write a program to demonstrate destructor call in the derived class.
PROGRAM CODE:
11
OUTPUT:
12
EXPERIMENT- 08
OBJECTIVE:
Write a C++ Program to append the content of a file.
PROGRAM CODE:
OUTPUT:
13
EXPERIMENT- 09
OBJECTIVE:
Write a C++ Program to create a file.
PROGRAM CODE:
OUTPUT:
14
EXPERIMENT- 10
OBJECTIVE:
Write a program in C++ to demonstrate virtual function.
PROGRAM CODE:
OUTPUT:
15
EXPERIMENT- 11
OBJECTIVE:
Write a program in c++ to demonstrate friend value.
PROGRAM CODE:
OUTPUT:
16
EXPERIMENT- 12
OBJECTIVE:
Write a program to implement an Account Class with member functions to
Compute Interest, Show Balance, Withdraw and Deposit amount from the
Account.
PROGRAM CODE:
17
18
OUTPUT:
19
EXPERIMENT- 13
OBJECTIVE:
Write a program to implement a class ‘Complex’ of complex numbers. The
class should be included member functions to add and subtract two complex
numbers.
PROGRAM CODE:
20
OUTPUT:
21
EXPERIMENT- 14
OBJECTIVE:
Write a program to implement a sphere class with appropriate members and
member function to find the surface area and the volume.
PROGRAM CODE:
OUTPUT:
22
EXPERIMENT- 15
OBJECTIVE:
Write a c++ program to implement a class for complex number with add and
multiply as member function. Overload ++operator to increment a complex
number.
PROGRAM CODE:
23
OUTPUT: