Tribhuvan University

Institute of Science and Technology

2076

Bachelor Level / second-semester / Science

Computer Science and Information Technology( CSC166 )

Object-Oriented Programming

Full Marks: 60 + 20 + 20

Pass Marks: 24 + 8 + 8

Time: 3 Hours

Candidates are required to give their answers in their own words as far as practicable.

The figures in the margin indicate full marks.

Group A

Attempts any TWO Questions

1

Write a program according to the specification given below:

  • – Create a class Account with data members acc no, balance, and min_balance(static)
  • -Include methods for reading and displaying values of objects
  • – Define static member function to display min_balance
  • -Create array of objects to store data of 5 accounts and read and display values of each object
2

Explain the concept of operator overloading? List the operators that cannot be overloaded. Write programs to add two object of distance class with data members feet and inch by using by using member function and friend function.

3

Explain types of polymorphism briefly. Write down roles of polymorphism. How can we achieve dynamic polymorphism briefly? Explain with example.

Group B

Attempts any EIGHT Questions

4

How object oriented programming differs from object based programming language? Discuss benefits of OOP.

5

What is the use of new and delete operators? Illustrate with example. What are advantages of new malloc.

6

What is destructor? Write a program to show the destructor call such that it prints the message “memory is released”.

7

What is this pointer? How can we use it for name conflict resolution? Illustrate with example.

8

How can you define catch statement that can catch any type of exception? Illustrate the use of multiple catch statement with example.

9

Which functions can be used for reading and writing object? Describe briefly. Write a program that read values of two objects of student class(assume data members are sid , sname, and level) and display the data in monitor.

10

Which functions can be used for reading and writing object? Describe briefly. Write a program that read values of two objects of student class(assume data members are sid , sname, and level) and display the data in monitor.