Question: Please help me with this entire C++ lab example. I will provide the given codes below the pictured instructions. thank you so much // StringDriver.h

Please help me with this entire C++ lab example. I will provide the given codes below the pictured instructions. thank you so much

Please help me with this entire C++ lab example. I will provide

the given codes below the pictured instructions. thank you so much //

// StringDriver.h

#ifndef _STRINGDRIVER_H

#define _STRINGDRIVER_H

#include "String.h"

#include "ReverseString.h"

#include "CaseString.h"

int main();

void test1();

void test2();

void test3();

void test4();

void test5();

void test6();

void test7();

void test8();

void test9();

void test10();

void test11();

void test12();

void test13();

void test14();

void test15();

void test16();

void test17();

void test18();

void test19();

void test20();

void wait();

#endif

-------------------------------------------------------------------------------------------------------------------------

// StringDriver.cpp

#include

#include

#include

#include "StringDriver.h"

using namespace std;

ofstream csis;

int main() {

csis.open("csis.txt");

test1();

test2();

test3();

test4();

test5();

test6();

test7();

test8();

test9();

test10();

test11();

test12();

test13();

test14();

test15();

test16();

test17();

test18();

test19();

test20();

csis.close();

}

void test1() {

cout

csis

String s1;

s1.print();

wait();

}

void test2() {

cout

csis

String s2("ABC");

s2.print();

wait();

}

void test3() {

cout

csis

String s3('Z');

s3.print();

wait();

}

void test4() {

cout

csis

String s4(10);

s4.print();

wait();

}

void test5() {

cout

csis

String s5("Purple Rain");

s5.print();

String t5(s5);

t5.print();

wait();

}

void test6() {

cout

csis

String s6('*', 10);

s6.print();

wait();

}

void test7() {

cout

csis

String s7("Sally Ride"), t7, u7;

t7 = u7 = s7;

s7.print();

t7.print();

u7.print();

wait();

}

void test8() {

cout

csis

String s8("ABC");

s8 = s8;

s8.print();

wait();

}

void test9() {

cout

csis

String s9;

s9 = "ABC";

s9.print();

wait();

}

void test10() {

cout

csis

String s10("DEF");

String t10('H');

String u10("ABC" + s10 + "G" + t10 + 'I');

u10.print();

String v10('X' + u10);

v10.print();

wait();

}

void test11() {

cout

csis

String s11('A');

String t11("BC");

s11 += s11 += t11 += 'D';

s11.print();

t11.print();

wait();

}

void test12() {

cout

csis

String s12("Unary +");

String t12(+s12);

s12.print();

t12.print();

s12 = +s12;

s12.print();

wait();

}

void test13() {

cout

csis

String s13("ABC"), t13("ABCD");

s13.print();

t13.print();

cout

cout

cout

cout

cout

cout " t13 ? "True" : "False")

cout = " = t13 ? "True" : "False")

csis

csis

csis

csis

csis

csis " t13 ? "True" : "False")

csis = " = t13 ? "True" : "False")

wait();

}

void test14() {

cout

csis

String s14("C++ is fun.");

for (int i = -1; i

char& ch = s14[i];

if (ch != '\0')

++ch;

}

s14.print();

wait();

}

void test15() {

cout

csis

String s15("ABCDE");

for(int i = 0; i

++(*(s15+i));

for (int j = 0; j

cout

csis

}

cout

csis

wait();

}

void test16() {

cout

csis

String s16("ABC");

String t16(++s16);

s16.print();

t16.print();

String u16("ABC");

String v16(u16++);

u16.print();

v16.print();

String w16("ABC");

String x16(--w16);

w16.print();

x16.print();

String y16("ABC");

String z16(y16--);

y16.print();

z16.print();

wait();

}

void test17() {

cout

csis

String s17("All You Need Is Love"), t17;

t17 = s17.substr(4, 8);

s17.print();

t17.print();

wait();

}

void test18() {

cout

csis

String s18("Red-");

String t18("Green-");

String u18("Blue");

cout

csis

cout

csis

wait();

}

void test19() {

cout

csis

ReverseString s19("Computer");

ReverseString t19;

t19 = ~s19;

s19.print();

t19.print();

ReverseString u19(~~s19);

u19.print();

wait();

}

void test20() {

cout

csis

CaseString s20("BaLLooN");

CaseString t20;

t20 = s20;

s20.print();

t20.print();

CaseString u20(s20);

u20.print();

wait();

}

void wait() {

char buf;

cout

csis

cin.get(buf);

}

u were to put this class into a library and nce its intuitive. Now suppose yo existence so could take advantage of it. But someone then says to you, "The so that use function so that users that I meant to overload the unary as a The class is fine, except uence of letters in the string and returnis that it reverses the sequence of letters in the str s case t shouldI would be new instance o for the user to derive a new class from the string class and add the reated the capabilities of the original class will still be there, plus the added capabi features, the new class really is a kind of String class. class, all of of more String class with Write a class called ReverseString that is publicly derived from the st class, with the following member functions: a default constructor function a copy constructor function a constructor function that takes a const char as its one argument an overloaded assignment operator . an overloaded unary operator-() function that reverses the letters of the string itself, and returns a new Reversestring instance by value (note that the actual contents of the string literal pointed to by buf are never modified) Write a class called Casestring, that is publicly derived from the String class, with the following data members: a pointer, upper, of type char*, which holds the contents of the string literal in upper case a pointer, lower, of type char, which holds the contents of the string literal in lower case Focus on Object-Oriented Programming with C++ Page 454

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!