C++ Define a class called MyString. MyString should contain a Menu as follow: My first MyString Menu Option Cost ======================================= 1. Create a substring $5 2. Find a reference $10 3. Remove part of the string $7 4. Add two strings to each other $4 5. Check if a string is empty $1 6. Check if two strings are equal $6 7. Insert a string inside another string $3 8. Exit The user will enter two strings str1 and str2 and should be able to keep selecting options until option 8 is selected (exit). After each selection the cost amount will change. At the end of each selection you should print out the result and at the end printout the following: Your total cost is: $15 (or whatever is the sum)
C++
Define a class called MyString.
MyString should contain a Menu as follow:
My first MyString Menu
Option Cost
=======================================
1. Create a substring $5
2. Find a reference $10
3. Remove part of the string $7
4. Add two strings to each other $4
5. Check if a string is empty $1
6. Check if two strings are equal $6
7. Insert a string inside another string $3
8. Exit
The user will enter two strings str1 and str2 and should be able to keep selecting options until option 8 is selected (exit). After each selection the cost amount will change. At the end of each selection you should print out the result and at the end printout the following:
Your total cost is: $15 (or whatever is the sum)
(Hint: for the functions use table 1 and table 2)
Table 1
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images