Question 2: Explain a pure virtual function with an example.
Question 3: What are the advantages and disadvantages of inline functions?
Question 4: Explain the meaning of polymorphism. Describe how polymorphism is accomplished in C++ taking a suitable example?
Question 5: Explain the following functions (with example) for manipulating
file
pointers:
seekg()
seekp()
tellg()
tellp()
Question 6: Write a template class “binary_tree” in C++. The class should have functions for creation of the tree, insertion and deletion of an element, searching a key value in the tree, Post order traversal and output the value in ascending order. Make suitable assumptions, if any.
Question 7: Define the class Student which has name (char name[20]) and age(int). Define the default constructor, member functions get_data() for taking the name and age of the Student, print() for displaying the data of Student.
Question 8: Write a program having a base class Student with data
member rollno and member functions getnum() to input rollno and putnum()
to display rollno.
A class Test is derived from class Student with data member marks
and member functions getmarks() to input marks and putmarks() to display
marks. Class Sports is also derived from class Student with data member
score and member functions getscore() to input score and putscore()
to display score. The class Result is inherited from two base classes,
class Test and class Sports with data member total and a member function
display() to display rollno, marks, score and the total(marks + score).