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
Write a program according to the specification given below:
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.
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
How object oriented programming differs from object based programming language? Discuss benefits of OOP.
What is the use of new and delete operators? Illustrate with example. What are advantages of new malloc.
What is destructor? Write a program to show the destructor call such that it prints the message “memory is released”.
What is this pointer? How can we use it for name conflict resolution? Illustrate with example.
How can you define catch statement that can catch any type of exception? Illustrate the use of multiple catch statement with example.
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.
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.