Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class BCheckString that is derived from the STL string class. This new c

ID: 3624452 • Letter: W

Question

Write a class BCheckString that is derived from the STL string class. This new class will have two member functions:

A) A BCheckString(string s) constructor that receives a string object passed by value andpasses it on to the base class constructor.

B) An char operator[](int k) function that throws a BoundsException object if k is negative or greater than or equal to the length of the string. If k is within the bounds of the string, this function will return the character at position k in the string.

You will need to write the definition of the BoundsExceptin class. Test you class with a main function that attempts to access characters that are within and outside the bounds of a suitably initialized BCheckString object.

Explanation / Answer

a

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote