Semester : SEMESTER 6
Subject : Object Oriented Programming
Year : 2020
Term : SEPTEMBER
Scheme : 2015 Full Time
Course Code : EC 312
Page:1
03000EC312052002
Pages: 2
Reg No.: Name:
Max. Marks: 100
1
3
a)
b)
a)
b)
a)
b)
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
Sixth semester B.Tech degree examinations (S), September 2020
Course Code: EC312
Course Name:Object Oriented Programming
PART A
Answer any two full questions, each carries 15 marks
Mention any 4 benefits and any 4 applications of OOP.
Write the following program. Create a class named distance with private
variables x1, yl, x2, y2. Write a parameterized constructor to initialize the
member variables. Write a member function to compute the distance between the
points (x1, 91) and (x2, y2). Write a member function to display the values
of x1, yl, x2, 372 and the distance between them. Write ೩ main function to
test the class.
What is unary operator overloading? Explain with a sample code.
What type of inheritance does the following code implement?
Identify and correct the error in the following code, if any. Explain the program and
the output.
#include
using namespace std;
class Automobile {
public:
Automobile () {
cout<< "This is an Automobile" <
7
class TwoWheeler {
public:
TwoWheeler() {
cout<< "This is a 2 wheeler Vehicle" <
7
class Bike: public Automobile, public TwoWheeler {
7
int main()
{
Bikeobj;
return 0;
}
Write a program in C++ to print all the numbers less than 100 in the Fibonacci
series.
Explain with proper diagrams any 4 types of inheritance in C++.
Page 1 of 2
Duration: 3 Hours
Marks
(8)
(7)
(7)
(8)
(7)
(8)