I need help completing the following program, please someone help!
Problem 2: In this program, you are going to create a class called "mystring," which is derived from the class "string."
Class "mystring" should include:
- A private data member "id," which is an integer representing the ID of a string (see example in the function "main()").
- A public method, constructor "mystring(int, char*)" which has two parameters: an integer (int) and a string (char*).
- It should (1) call the base class constructor using the string parameter (char*) and (2) assign the integer parameter (int) to "id."
- A public method "int getid()" which returns the id of the class "mystring."
Code:
#include <iostream>
#include <string>
using namespace std;
// Your code goes here
// If your class is implemented correctly, the main program should work as follows:
int main()
{
mystring x(101, "Hello Kitty"); // "Hello Kitty" has an ID 101
cout << x.getid() << endl; // display 101
cout << x << endl; // display string value: "Hello Kitty"
cout << x.length() << endl; // display length of the string: 11
return 0;
}