I am having an extremely difficult time with this programming challenge I have to do. I have no idea where to begin on this. I am a beginning programmer (obvious I know), and here are my instructions for the challenge:
"Write a class EncryptableString that is derived from the STL string class. The EncryptableString class adds a member function
void encrypt( )
That encrypts the string contained in the object by replacing each letter with its successor in the ASCII ordering. For example, the string baa would be encrypted to cbb. Assume that all characters that are part of an EncryptableString object are letters a..z and A...Z, and that the successor of z is a and the successor of Z is A. Test your class with a program that asks the user to enter strings that are then encrypted and printed.
If someone can maybe lay these instructions out in a more clear and simplified form so I can possibly comprehend it better. I am quite confused on how this should be done.
This is what tiny little beginning I have, hopefully it's right. I still need a lot of help on laying out where the stuff should go, and then of course actually doing it. Any help would be greatly appreciated.
EncryptableString.h
#include <iostream>
#include <string>
using namespace std;
class EncryptableString
{
public:
EncryptableString();
void encrypt();
};
EncryptableString.cpp
#include "EncryptableString.h"
#include <iostream>
#include <string>
using namespace std;
void EncryptableString::encrypt()
{
// Encryption Code Here
}
EncryptString.cpp
#include "EncryptableString.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
EncryptableString.encrypt();
cin.get();
return 0;
}