Nov/Dec_2022 18EECE421
SRN
VII Semester B.E. Examination
(Electronics and Communication Engineering)
OOPS with C++ (18EECE421)
Duration: 3 hours Max. Marks: 100
Note: i) Answer any TWO full questions from UNIT-I, any TWO full questions from UNIT-II
and any ONE full question from UNIT-III.
ii) Assume suitable data if necessary with justification
UNIT-I
1 a. Explain the effect of inheritance when derived by different access specifiers with
appropriate examples. (06marks)
b. Write a program that creates computer application model by using classes. (07marks)
Program should be able to add, delete, modify and view the record by using
member functions.
Make sure following qualities should be implemented
Type
Capacity
c. What is the special feature offered by C++ to achieve dynamic binding? Explain.
Write a C++ program to demonstrate run-time polymorphism. (07marks)
2 a. All the banks operating in India are controlled by RBI. It has set a well defined
guidelines(ex. min interest rate, min balance allowed, max withdrawal limit etc) (07marks)
which all the banks must follow.
Suppose, RBI has set min interest rate applicable to a savings bank account to be
4% annually; However, banks are free to use 4% interest or any other rates above.
Write a program to implement bank functionality in above scenario.
Note: Create few classes namely customer, account, rbi, sbi etc.
Assume and implement required member variables and functions in each class.
b. What is the need of constructors and destructors in C++ programming?
Write a program to illustrate the order of constructor invocation when derived (07marks)
classes are involved.
c. Write short notes on (06marks)
1. Pure virtual functions
2. this pointer with suitable examples
3 a. With a programming example, Explain different types of parameter passing
techniques in C++. (06marks)
b. What characteristics of static member variable make it special.
Write a C++ program to declare, define and access public static data members. (07marks)
c. Why do we say that hierarchial inheritance results in ambiguity. Write a C++
program to read and print employee information with department using (07marks)
hierarchical inheritance.
Page 1
UNIT-II
4 a. Why is it necessary to overload an operator? Why cant we overload few
operators? Give substantial reasons to justify your answer. (06marks)
b. In certain situations, user makes a function inline. How is it different from a (07marks)
preprocessor macro?
Write a C++ program using inline functions without class to reverse a number.
c. How are reference variables different from pointers. Write a program to illustrate (07marks)
returning references from a function.
5 a. (06marks)
What are the advantages of OOP over structured programming?
b. i. Explain the concept of pointer to an object with an example
ii. Explain the order of constructor and destructor called in multi-level (07marks)
Inheritance.
c. Differenciate between early binding and late binding with an example. Explain
how late binding can be achieved in C++. (07marks)
6 a. (07marks)
How are copy constructor and assignment operator different in C++? Discuss
b. Discuss the need of virtual base class. Show how a virtual base class eliminates
(06marks)
ambiguity.
c. “Overloading is a type of polymorphism”. Elaborate the given statement with the
(07marks)
help of suitable example using the concept of function overloading.
UNIT-III
7 a. What is the syntax for creating objects for class templates. (10marks)
Using class templates, input n numbers and perform array sorting.
b. Explain function template with an example. List the advantages and
(10marks)
disadvantages of using templates in C++ programming.
8 a. Write a C++ program to explain the process of stack unwinding. List the (10marks)
advantages of the same.
b. A cultural event is organised by the college students. Create a registration (10marks)
window using C++ programming to ask fore username and password by the
attendees using file handling.
Page 2