Semester : SEMESTER 6
Subject : Object Oriented Programming
Year : 2019
Term : DECEMBER
Scheme : 2015 Full Time
Course Code : EC 312
Page:1
E F192082 Pages:2
Reg No.:_. Name:
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
SIXTH SEMESTER B.TECH DEGREE EXAMINATION(S), DECEMBER 2019
Course Code: EC312
Course Name:Object Oriented Programming
Max. Marks: 100 Duration: 3 Hours
PARTA
Answer any two full questions, each carries 15 marks Marks
1 a) Write aclass to represent a 3D vector. Include member functions to perform the (10)
following tasks:
i) to create the vector
ii) to multiply by a scalar value
iii) find the magnitude of vector
iv) to display the vector in the form (10, 20, 30,...)
Write a main function to implement this class.
b) What is the need of constructors in an object oriented program? Give any three (5)
constructors in C++.
2 a) Distinguish between class and object in ೩ program. (4)
b) With proper explanation, give the output of the following program (8)
#include
void calc(int& x,int y)
{ inttemp=x+y;
x+ = temp;
yt=temp;
}
void main( )
{ int a = 50,b=20;
calc(a,b);
cout<< ಓರ್ ಅರಸರು ಲ;
}
c) What is a virtual base class? (3)
3 a) Explain the characteristics of a friend function. Write a programming example to (8)
demonstrate the use of a friend function as the bridge between two classes.
b) Write a program to demonstrate multiple inheritance in C++ (7)
PART 1
Answer any two full questions, each carries 15 marks
4 a) What isa virtual function? Why do we need virtual function in an object oriented (8)
program?
b) Compare and contrast Java and C++. (7)
5 a) Give a programming example to show the use of a pure virtual function. (8)
b) What is a multi-threaded program? How Java implements multi-threaded (7)
program?
Page 1 of 2