Computer Engineering (Semester 3)
Total marks: 80
Total time: 3 Hours
INSTRUCTIONS
(1) Question 1 is compulsory.
(2) Attempt any three from the remaining questions.
(3) Draw neat diagrams wherever necessary.
SECTION 1
1.a. Define Constructor, Destructor. Write a program to explain use of new, delete, constructor and destructor.
(6 marks)
00
1.b. What is the difference between Inheritance and containment? Write a program in C++ to defend your answer.
(6 marks)
00
Or
2.a. What is Operator overloading? Using friend function show how to overload increment (++) operator. Assume suitable class data members and
member functions.
(6 marks)
00
2.b. List and explain various features of object oriented programming.
(4 marks)
00
2.c. Define class as ADT.
(2 marks)
00
3.a. How smart pointer avoids the problem of memory leak.
(4 marks)
00
3.b. How function overloading and function templates are related to each
other. state valid example to justify your answer.
(4 marks)
00
3.c. Create a user define exception to check whether your employee exist in your data structure (use any data structure to store the employees) and throw exception if name is not in the employees list. Use the catch block to print an appropriate message on the screen.
(5 marks)
00
Or
4.a. Explain pointer to a variable and pointer to a function. Use suitable example.
(6 marks)
00
4.b. What are friend function and static function?
(6 marks)
00
4.c. What is the need of exception handling?
(3 marks)
00
5.a. What is a Stream? Explain types of Stream available in C++.
(5 marks)
00
5.b. Write a program to create a file,read and write the record
into it. Every record contains employee Name,Id,and Salary. Store and
retrieves at least 3 employee data.
(7 marks)
00
Or
6.a. Explain following file handling function
I. open() II. get() III. getline() IV. seekg() V. tellg()
(10 marks)
00
6.b. What are cin and court ? Explain iostream.
(3 marks)
00
7.a. What is the purpose of Iterator? Elaborate forward, bidirectional and random-access iterators with suitable example.
(6 marks)
00
7.b. What is stack? How it is implemented using STL.
(6 marks)
00
Or
8.a. Elaborate advantages and disadvantages of following Basic Sequence Containers a) Vector b) List
(6 marks)
00
8.b. What is the STL? Why should a C++ programmer be interested in the
STL? What is the design philosophy of the STL? What are the major components of
the STL?
(6 marks)
00