OOP I Scheme 2022 23 Class Test II Question Bank

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Q.1) 2 marks questions.

(08)

a) Differentiate between run time and compile time polymorphism


b) Draw hierarchy of stream classes for file operations.
c) State and explain the visibility modes used in inheritance.
d) Give syntax of and explain various functions related to ifstream and ofstream classes
1) seekp() 2) getline() 3) hide() 4) tail()
e) Difference between Multiple and Multi level inheritance.
f) List and explain use of any four file mode parameters
g) Describe Address (&) and Value of (*) operator.
h) What is inheritance? Give different types of inheritance.
i) Write a C++ program to swap two numbers using pointer
j) What are the rules for virtual function?
k) What is parameterized constructor?

Q.2) 4 mark questions. (12)

a) Describe the concept of virtual base class with suitable example.


b) Write a program that copies contents of one file into another file.
c) Write a C++ program to implement inheritance shown in following figure:

Class : Teacher Class : Student


data member : Name data member : SName
empid RollNo

Class : Info

Accept and display data of one teacher and one student using object of class ‘Info’.
d) Write a C++ program to overload binary operator ‘+’ to concatenate two strings.
e) Describe with examples, passing parameters to base class constructor and derived class
constructor by creating object of derived class.
f) Write a C++ program to overload area() function to calculate area of shapes like triangle
,square, circle.
g) Write a C++ program to count number of spaces present in contents of file.
h) Write a C++ program to implement following inheritance.

Class : Employee
Data Member : empid
empcode

Class : Programmer Class : Manager


data member : Skill data member: department
i) Accept and display data for one programmer and one manager. Make display function
virtual. Write a program in C++ to overload unary ‘_’ operator to negate values of data
members of class.
j) Write a program to count the number of lines in file.

You might also like