problem 1)a) prepare down the differences between lval and rval. Give one ex.
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 ex.
problem 2)a) What are nested classes? Describe how name resolution proceeds in a nested class definition with exs.
b) What are constructors and destructors? Describe how constructors can be overloaded using different types of constructors giving exs.
c) What is memberwise initialization? Give one suitable ex.
problem 3)a) For the ‘time’ class which stores information of hours, minutes and seconds provide an overloaded += operator to add two ‘time’ objects. prepare 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
problem 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 ex.