Pokhara University
Bachelor of Engineering in Computer Engineering
Semester 2 · PU Spring
Course Title: Object Oriented Programming in C++
Full Marks: 100Pass Marks: 45Time: 3 hrs
Candidates are required to give their answers in their own words as far as practicable.
- 1.20
2 Wat makes sijestorjetfGal progratiaing better than procedure-oriented programming? Justify your answer with features ; of object-oriented programming. _ @) List out the advantages of adopting RDD. Dssw-€RC cards for Library Management system. ‘ :
- 2.7
ea What are static data members and static functions? Explain with: examples. 77 What is constructor? Explain three types of constructor with example: 8 ) program. :
- 3.37
a)_—Create a class Person with data members Name and age. Derive a \8 : ee class Employee from Person with its data member employee_id. Derive another class Manager from Employee with its data member department. Receive the data_members from each class's member . function and display the data of all classes from the class Manager.
- b) How composition differs from inheritance? Write a program to concatenate two strings (name and address of a person) using the concept of containership.
OR
A oscios the time of hybrid inheritance when there is hierarchical inheritance at the upper level and multiple inheritance at lower level; ambiguity occurs due to duplication of data from multipath at the grand child class. How this kind of ambiguity is resolved? Explain with suitable example. 4, @) What is the major difference between compile time and runtime \ polymorphism? er runtime polymorphism can be achieved? Explain with example. ay What do you mean by type casting? Write a Program toconvertan So ee object of Rectangle class into the object of Polar class by using type conversion routine.
OR
What are functions overloading and overriding? Explain with examples. 5. we What are the advantages of function template? Create a function template to swap two infegers, two floating point data and two characters. b)- What is the Standard Témplate Library (STL)? Explain any one 8° container of STL with example. 6. aa is exception? Describe exception handling in C++ with 7. example. ' Danie a program that prompts the user to enter their name and age, write the entered data into a file named “userinfo.txt”, read the details . from “userinfo.txt” and display the data on the console. 7. Write short notes on: (Any two) 2x5
- a) Software reusability x Ds Dynamic Memory Allocation Oy Computation as simulation Bh TEST TY
— The End —