Question: Specifications for the arizona::string class public: Declare the default constructor Declare parameterized constructor that accepts a std::string variable which sets the private std::string variable Declare

Specifications for the arizona::string class public: Declare the default constructor Declare parameterized constructor that accepts a std::string variable which sets the private std::string variable Declare function to return the private std::string variable. Accepts no input check that the private variable has been set. If it has not, print "ERROR: arizona::string uninitialized (test will check for this exact string). Declare function to return a the flipped string stored in the private variable. Accepts no input Declare - (minus) operator to set the private string value Declare ~ (tilde) operator to return the size of the string (an integer value) Declare function to clear the data member, i.e., sets back to the default value. Returns nothing and accepts nothing private: Declare the string (from std) that is stored Declare function to return a flipped string. Returns a std::string variable that is the flipped string of what is stored in the private variable. Accepts no input. Sample code: #include "string.hpp" #include "stringTests.hpp" #include int main(int argc, const char * argv[]) { // Program to illustrate operator overloading and // namespaces // Declare the string object we created std::string test = "I am fast. To give you a reference point I am somewhere between a snake and a mongoose And a panther - Dwight K. Schrute"; arizona::string s(test); std::cout << s.getString() << std::endl; arizona::string s2; s2 - test; std::cout << s2.getFlippedString() << std::endl; std::cout << ~s2 << std::endl; s2.destroy(); std::cout << s2.getString() << std::endl; return EXIT_SUCCESS; } Sample output: I am fast. To give you a reference point I am somewhere between a snake and a mongoose... And a panther - Dwight K. Schrute eturhcS .K thgiwD - rehtnap a dnA ...esoognom a dna ekans a neewteb erehwemos ma I tniop ecnerefer a uoy evig oT .tsaf ma I 123 ERROR: arizona::string uninitialized Hint: How to reverse a string (where s and sFlipped are both std::string variables) for (int i = int(s.size()) - 1; i >= 0; i--){ sFlipped.push_back(s.at(i)); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!