0% found this document useful (0 votes)
167 views2 pages

OOP I Scheme 2022 23 Class Test II Question Bank

This document contains questions that test knowledge of C++ concepts related to inheritance, polymorphism, file input/output, and operator overloading. It includes questions about: 1. The difference between run time and compile time polymorphism, stream class hierarchy, inheritance visibility modes, ifstream and ofstream functions like seekp(), getline(), hide(), and tail(). 2. Virtual base classes with an example, copying contents from one file to another, implementing inheritance with classes Teacher, Student and Info, overloading the + operator to concatenate strings, passing parameters to base and derived class constructors. 3. Overloading the area() function for shapes, counting spaces in a file, implementing inheritance with classes Employee

Uploaded by

Mohit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views2 pages

OOP I Scheme 2022 23 Class Test II Question Bank

This document contains questions that test knowledge of C++ concepts related to inheritance, polymorphism, file input/output, and operator overloading. It includes questions about: 1. The difference between run time and compile time polymorphism, stream class hierarchy, inheritance visibility modes, ifstream and ofstream functions like seekp(), getline(), hide(), and tail(). 2. Virtual base classes with an example, copying contents from one file to another, implementing inheritance with classes Teacher, Student and Info, overloading the + operator to concatenate strings, passing parameters to base and derived class constructors. 3. Overloading the area() function for shapes, counting spaces in a file, implementing inheritance with classes Employee

Uploaded by

Mohit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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