0% found this document useful (0 votes)
40 views4 pages

DCO-312 Practical File

This document is a practical record for an Object Oriented Programming lab course. It lists 15 programming assignments completed by the student to develop skills in C++ programming concepts like control structures, functions, classes, inheritance, and friend functions. The final assignment involves writing a C++ program to demonstrate friend functions and friend classes by defining a Temperature class and having a friend function set and return the private celcius variable.

Uploaded by

skri d
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)
40 views4 pages

DCO-312 Practical File

This document is a practical record for an Object Oriented Programming lab course. It lists 15 programming assignments completed by the student to develop skills in C++ programming concepts like control structures, functions, classes, inheritance, and friend functions. The final assignment involves writing a C++ program to demonstrate friend functions and friend classes by defining a Temperature class and having a friend function set and return the private celcius variable.

Uploaded by

skri d
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/ 4

OBJECT ORIENTED PROGRAMMING LAB

(DCO-312)

Submitted to:
Dr. Sunil & Ms. Farah Jamal Ansari
Assistant Professor

Submitted by
Student Name SHAYAN AHSAN
Roll No.:20DCS048
Semester: III SEMESTER

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 : SHAYAN AHSAN
University Roll No. : 20DCS048
Section : DIPLOMA IN COMPUTER ENGINEERING

PRACTICAL DETAILS
Practical Practical Name Date of Date of Marks/ Teacher’s
No. Performance Checking Grades Signature
1. 9th Sept,2021
WRITE PROGRAMS IN
C++ TO IMPLEMENT
VARIOUS CONTROL
STATEMENTS
2. Write the C++ programs to 23rdSept,202
understand Structure 1
3. Write the C++ program to 23rd
understand functions Sept,2021
4. Write a program in C++ to 23rd Oct,2021
Understand Pointer
Arithmetic
5. Write Programs in C++ to 29th
Understand different
Sept,2021
function call mechanism.
a. Call by Value b. Call
by reference
6. Write a program in C++ to 29th
understand classes and Sept,2021
objects
7. Write a program in C++ to 20th Oct,2021
understand inline function.
8. Write a program in C++ to 20th Oct,2021
understand Constructors &
Destructors.
9. Write a program in C++ 20th Oct,2021
using classes to
demonstrate the Use of
“this” Pointer.
10. Write Programs in C++ to 14thNov,202
Implement all types of 1
Inheritance.
11.

12.

13. Write a program in C++ to 14thNov,202


understand Friend Function 1
&Friend Class
14.

15.
PROGRAM 13: To Understand Friend Function &Friend Class
INPUT
#include<iostream>
using namespace std;

class Temperature{
private:
int celcius;
public:
Temperature(){
celcius=0;}
friend int temp(Temperature);
};
int temp(Temperature t)
{
t.celcius=52;
return t. celcius;
}
int main(){

Temperature tm;
cout<<"\n Temperature in Celcius:"<<temp(tm);

return 0;
}

OUTPUT

Temperature in Celcius:52

You might also like