Question 1)a) Write down the differences between lval and rval. Give one example.
b) Describe the basic concepts of object oriented programming.
c) What is a static data member? Where is it visible? What is its life time? Describe with an example.
Question 2)a) What are nested classes? Describe how name resolution proceeds in a nested class definition with examples.
b) What are constructors and destructors? Describe how constructors can be overloaded using different types of constructors giving examples.
c) What is memberwise initialization? Give one suitable example.
Question 3)a) For the ‘time’ class which stores information of hours, minutes and seconds provide an overloaded += operator to add two ‘time’ objects. Write a program to test this class. Provide default, parameterized and copy constructors. Take care of range of value for hours, minutes and seconds. Overload (<<) to display time.
b) Design a generic queue class. Include member functions to
i) Add to the queue
ii) Delete from the queue
iii) Display the queue
Question 4)a) A file named “file1” contains multiple lines of text.(more than one word in a line). Copy this file into another file named “file2” with occurrences of the word “spell” replaced with “spelt” and other words not changed Display “file2” on the screen.
b) What happens when there is a program segment that has more than one condition to throw an exception? Describe with suitable example.