Obtain the source code for the PFArray class from Chapter 10 shown in Display 10.11 . Modify the definition of the overloaded operator, [] , so it throws an OutOfRange exception if an index that is out of range is used or if an attempt is made to add an element beyond the capacity of the implementation. OutOfRange is an exception class that you define. The exception class should have a private int member and a private string member, and a public constructor that has int and string arguments. The offending index value along with a message should be stored in the exception object. You choose the message to describe the situation. Write a suitable test program to test the modified class PFArray.
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.