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

Bachelors In Information Technology

Institute of Science and Technology, TU

Object Oriented Programming (BIT153)

Year Asked: 2078, syllabus wise question

Basics of C++ programming
1.
Explain Memory Management Operators of C++ with example. [5]
2.
Explain Call by Value and Call by Reference with appropriate example. [5]
Class and Objects
1.
Create a class Employee with private data members Eid, Ename, and Salary. Include public member functions read and display value of data members. Derive a class names typist from above class. The class should contain a private data members. Finally create two objects of typist class and read and display their values. [10]
2.
Create a class called time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments. A main() program should create two initialized time objects (should they be const) and one that isn't initialized. Then it should add the two initialized values together, leaving the result in the third time variable. Finally, it should display the value of this third variable Make appropriate member functions const. [10]
3.
Describe types of constructors with an example. [5]
4.
Explain use of objects as function arguments with example [5]
File and Streams
1.
Write a program that writes the contents of file 1 into file 2. [5]
Function Templates and Exception Handling
1.
What is exception handling? Explain how to handle an exception with appropriate example. [5]
Introduction to Object Oriented Programming
1.
What is object-oriented programming? How does it differ from procedure-oriented programming? Explain features of object oriented programming. [10]
Operator Overloading
1.
Lost out various type conversion techniques? Explain basic to user-defined type conversion with example. [5]
Virtual Function, Polymorphism, and other C++ Features
1.
How-late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example. [5]
2.
Explain pure virtual functions with example. [5]