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

Object Oriented Programming in C++

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 a series of questions covering various topics such as software development processes, class structures, dynamic memory allocation, inheritance, and exception handling. Candidates are expected to provide answers in their own words and complete programming tasks within a 3-hour time frame.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Object Oriented Programming in C++

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 a series of questions covering various topics such as software development processes, class structures, dynamic memory allocation, inheritance, and exception handling. Candidates are expected to provide answers in their own words and complete programming tasks within a 3-hour time frame.
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++ 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) Why software development process is not linear? List out the 7
significance of forming abstraction while designing an
object-oriented system.
b) Write an advantage of friend function. Write a program to add private 8
data of two classes using friend function.
2. a) Why is class preferred over structure? Support your answer with 8
suitable OOP features and program.
b) Create a C++ program to define a class Height with data members 7
feet and inches. Implement a constructor to initialize feet and inches.
Create a method addHeight() that takes two heights and adds them
together and a display() function to display the result.
3. a) Why dynamic memory allocation is better than static memory 8
allocation? How dynamic memory allocation can be achieved in
C++? Explain with suitable example.
b) Write a complete program based on the provided figure. Note that 7
alpha, beta, and gamma are class names, and showa(), showb(), and
showg() are functions that display the data members of their
respective classes.

Page 1 of 2
4. a) Differential between subclass and subtype? How is ambiguity 8
resolved in multiple inheritances? Explain with suitable program.
b) Explain about is a rule and has a rule. Write a program for 7
composition in class.
5. a) Define two class ‘polar’ and ‘rectangle’ to represent points in polar 8
and rectangular coordinate. Use conversion routine in source object
to convert polar coordinate to rectangular coordinate.
b) What is a virtual function? When and how do we make a function 7
virtual? Explain with a suitable example.
6. a) What is exception? How is it handled in C++? Write a program to 8
handle exception with multiple catch blocks.
b) Explain CRC cards and sequence diagram with suitable examples. 7
7. Write short notes on: (Any two) 2×5
a) Function overloading
b) This pointer
c) Programming in small and programming in large

Page 2 of 2

You might also like