Semester : SEMESTER 6
Subject : Object Oriented Programming
Year : 2018
Term : APRIL
Scheme : 2015 Full Time
Course Code : EC 312
Page:1
E E6801 Pages: 2
Reg No.: Name:
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
SIXTH SEMESTER B.TECH DEGREE EXAMINATION, APRIL 2018
Course Code: EC312
Course Name: OBJECT ORIENTED PROGRAMMING (EC)
Max. Marks: 100 Duration: 3 Hours
PART A
Answer any two full questions, each carries 15 marks. Marks
1 a) Create a class in C++ having three members (an integer number, sum of digits of (8) the
number and a single digit formed by finding the sum of digits of the number until the number is
a single digit). Include appropriate functions to enter the number from user end, do calculations
and displaying. Also include appropriate constructors for initialising all members to zero.
(eg: 1236, sum of digits =12,sum of digits as single digit =3)
Write a main program to test the class.
b) Explain inheritance and give the different types of inheritance in C++. Also (7) explain
public, private and protected access controls.
2 a) Explain what a friend function is. Write a C++ program to use friend function (8) acting as
bridge between two classes (sum of internal marks and university marks stored of a student
stored in two separate classes for 5 subjects). Prepare a mark list for the student.
b) Explain operator overloading. Give examples each for overloading unary and (7) binary
operators.
3 a) Write a C++ to print and find the sum of first 20 prime numbers. (10) 9) Explain what
an abstract base class is. Give uses. (5)
PART 8
Answer any two full questions, each carries 15 marks.
4 a) Explain with example program in C++ how the keyword virtual is used 10 (8)
implement dynamic binding. b) What are bytecodes and JVM? Explain how Java implements
Machine (5)
Independent Programming. реж) What is the use of import statement in a Java program? (2)
5 a) Can a pointer of base class type point to an object of the derived class? Explain. (7)
Page 1 of 2
E E6801 Pages: 2
b) Write a Java program to print and find the sum of squares of n numbers. (8)
6 a)class A (7)