0% found this document useful (0 votes)
89 views

Object Oriented Programming Lab (DCO-312)

The document contains details of 13 practical assignments completed by a student for their Object Oriented Programming lab, including programs written in C++ to demonstrate concepts like control statements, structures, functions, classes, inheritance, operator overloading, and friend functions and classes. It lists the assignment name and date of performance and checking for each practical completed by the student.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

Object Oriented Programming Lab (DCO-312)

The document contains details of 13 practical assignments completed by a student for their Object Oriented Programming lab, including programs written in C++ to demonstrate concepts like control statements, structures, functions, classes, inheritance, operator overloading, and friend functions and classes. It lists the assignment name and date of performance and checking for each practical completed by the student.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

OBJECT ORIENTED PROGRAMMING LAB

(DCO-312)

Submitted to: Submitted by:

Dr. Sunil & Ms. Farah Jamal Ansari Student Name: Zainul Aabidin
Assistant Professor Roll No.: 20DCS058
Semester: 3rd

Computer Engineering Section


University Polytechnic
Faculty of Engineering & Technology
Jamia Millia Islamia, New Delhi-110025
PRACTICAL RECORD
PAPER CODE -
: DCO 312
Name of the Student : Zainul Aabidin
University Roll No. : 20DCS058
Section : Computer Engineering

PRACTICAL DETAILS
Practical Practical Name Date of Date of Marks/ Teacher’s
No. Performance Checking Grades Signature

1. Write Programs in C++ 03/09/2021


Implement Various
controls Statements.
2. Write Programs in C++ 20/09/2021
to understand Structure.

3. Write Programs in C++ 20/09/2021


to understand Functions.
4. Write Programs in C++ 20/09/2021
to understand Pointer
Arithmatic.
5. Write Programs in C++ 25/09/2021
to understand different
functions call mechanism.
a. Call by value
b. Call by referance
6. Write Programs in C++ 25/09/2021
to understand Classes and
Objects.
7. Write a Program in C++ to 17/10/2021
Understand Inline
Functions.

8. Write a Program in C++ to 17/10/2021


Understand Constructors
& Destructors.
9. Write a Program in C++ 17/10/2021
Using Class to
Demonstrate the Use of
“this” Pointer.
10. Write Programs in C++ to 12/11/2021
Implement all types of
Inheritance.
11. Write Programs in C++ to 03/12/2021
Understand Operator
Overloading.
12. Write Programs in C++ to 03/12/2021
Understand Virtual
Functions and Dynamic
Polymorphism.
13. Write Programs in C++ to 12/11/2021
Understand Friend
Function and Friend Class.
13.Write Programs in C++ to Understand Friend Function and Friend Class.

// C++ program to demonstrate the working of friend function

#include <iostream>
#include<conio.h>

class Distance
{
private:
int meter;

// friend function
friend int addFive(Distance);

public:
Distance() : meter(0) {}

};

// friend function definition


int addFive(Distance d) {

//accessing private members from the friend function


d.meter += 5;
return d.meter;
}

int main() {
Distance D;
cout << "Distance: " << addFive(D);
return 0;
}
OUTPUT

Distance: 5
// C++ program to demonstrate the working of friend class

#include <iostream>
#include<conio.h>

// forward declaration
class ClassB;

class ClassA
{
private:
int numA;

// friend class declaration


friend class ClassB;

public:
// constructor to initialize numA to 12
ClassA() : numA(12) {}
};

class ClassB
{
private:
int numB;

public:
// constructor to initialize numB to 1
ClassB() : numB(1) {}

// member function to add numA


// from ClassA and numB from ClassB
int add()
{
ClassA objectA;
return objectA.numA + numB;
}
};

int main()
{
ClassB objectB;
cout << "Sum: " << objectB.add();
return 0;
}

OUTPUT

Sum: 13

You might also like