0% found this document useful (0 votes)
5 views

Object Oriented Programming in C++ (New)

This document outlines the examination structure for a Bachelor level course in Object Oriented Programming in C++ at Pokhara University for Spring 2024. It includes various questions covering topics such as the advantages of object-oriented programming, static members, constructors, inheritance, polymorphism, type casting, function templates, and exception handling. Candidates are required to answer all questions in their own words within a 3-hour time limit.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Object Oriented Programming in C++ (New)

This document outlines the examination structure for a Bachelor level course in Object Oriented Programming in C++ at Pokhara University for Spring 2024. It includes various questions covering topics such as the advantages of object-oriented programming, static members, constructors, inheritance, polymorphism, type casting, function templates, and exception handling. Candidates are required to answer all questions in their own words within a 3-hour time limit.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

POKHARA UNIVERSIT Y

Level: Bachelor Semester: Spring Year : 2024


Programme: BE Full Marks: 100
Course: Object Oriented Programming in C++ (New) Pass Marks: 45
Time : 3 hrs.
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) What makes object-oriented programming better than 7
procedure-oriented programming? Justify your answer with features
of object-oriented programming.
b) List out the advantages of adopting RDD. Draw CRC cards for 8
Library Management system.
2. a) What are static data members and static functions? Explain with 7
examples.
b) What is constructor? Explain three types of constructor with example 8
program.
3. a) Create a class Person with data members Name and age. Derive a 8
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 7
concatenate two strings (name and address of a person) using the
concept of containership.
OR
During 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. a) What is the major difference between compile time and runtime 7
polymorphism? How runtime polymorphism can be achieved?
Explain with example.
b) What do you mean by type casting? Write a program to convert an 8
Page 1 of 2
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. a) What are the advantages of function template? Create a function 7
template to swap two integers, two floating point data and two
characters.
b) What is the Standard Template Library (STL)? Explain any one 8
container of STL with example.
6. a) What is exception? Describe exception handling in C++ with 7
example.
b) Write a program that prompts the user to enter their name and age, 8
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) 2×5
a) Software reusability
b) Dynamic Memory Allocation
c) Computation as simulation

Page 2 of 2

You might also like