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: Model, syllabus wise question

Basics of C++ programming
1.
What is meant by default argument? Explain with suitable example. [5]
Class and Objects
1.
Write a program to create a class Customer with data members customer Id, Name, and age. Put member functions to read and display values of data members. Also define constructors to initialize data members with default value. Finally create object to read and display data of 10 customers. [10]
2.
What are the uses of this pointer? Discuss its concept with suitable example. [5]
3.
What is destructor? Discuss its characteristics with suitable example. [5]
File and Streams
1.
Write a program to read text from keyboard and write it to a file named "test.txt". Again read the content of file and display it in the monitor. [5]
Function Templates and Exception Handling
1.
Write a program to handle "array index out of range" exception. [5]
2.
Why concept of templates is important? Explain function templates with example. [5]
Inheritance
1.
Create a class Employee with private data members Eid, Ename, and Salary. Include public member functions to read and display value of data members. Derive a class names Typist from above class. The class should contain a private data member typing_speed and public member functions to read and display values of data members. Finally create two objects of typist class and read and display their values. [10]
2.
What is meant by ambiguity? Explain ambiguity in multiple inheritance and its solution with example. [5]
Operator Overloading
1.
Write a program to convert floating point value to object of distance class with data members feet and inch. [5]
Virtual Function, Polymorphism, and other C++ Features
1.
What are the different ways of achieving static polymorphism? Discuss overloading of pre-increment and post-increment operators with suitable examples. [5+5]
2.
How late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example. [5]