Bachelors Level/First Year/Second Semester/Science csit/second semester/object oriented programming/syllabus wise questions

B.Sc Computer Science and Information Technology

Institute of Science and Technology, TU

Object Oriented Programming (CSC166)

Year Asked: 2080.1, syllabus wise question

Classes & Objects
1.
What is destructor? List its characteristics. Explain the use of default copy constructor with an appropriate example. [10]
2.
What is the benefit of passing object as arguments? Write a program to create a class named actor with data members name and rating. Initialize the data members and display those names whose rating is greater than 5 using the concept of constant object. [5]
3.
Write short notes on: a. This pointer b. ios member function [5]
File handling
1.
Write a program that stores information of employees in a file and displays the file's content in ascending order of their salary. [5]
Function Templates and Exception Handling
1.
Explain function template overloading with suitable example. [5]
Inheritance
1.
Write a program to realize the above hierarchy. Create necessary member functions (constructor) to initialize and display necessary information.
question image
[10]
2.
Explain the practical implication of protected specifier in inheritance. List advantages and disadvantages of inheritance. [5]
Introduction to Object Oriented Programming
1.
Define object. What are the benefits of Object Oriented Programming Language? [5]
Operator Overloading
1.
Write a program to create a class named height with data members meter(int) and centimeter(int). Overload the binary + operator using friend function to add two heights. [10]
2.
Explain the significance of type conversion. How do we achieve dynamic memory allocation in C++? Explain with an example. [5]
3.
Create two classes Rupee and Dollar respectively. Write conversion operator to convert between Rupee and Dollar assuming that 1 dollar equals 133 rupees. Write a main program that allows the user to enter an amount in either currency and then converts it to other currency and displays the result. [5]
Virtual Function, Polymorphism, and miscellaneous C++ Features
1.
Difference between compile time and run time polymorphism. [5]