Please help reviewing the following code for caesar cipher (ccipher.h and ccipher.cc) which is giving incorrect output. It must inherit from susbtitution cipher (cipher.cc) which I include below as well as the wrong output and the expected output. There are no typos, I've made sure of it so that is not reason. SUBSTITUTION CIPHER cipher.cc #include "cipher.h" /* Cheshire smile implementation. It only contains the cipher alphabet */ struct Cipher::CipherCheshire { string cipher_alpha; }; /* This function checks the cipher alphabet to make sure it's valid */ bool is_valid_alpha(string alpha); // ------------------------------------------------------- // Cipher implementation /* Default constructor This will actually not encrypt the input text because it's using the unscrambled alphabet */ Cipher::Cipher() { // TODO: Implement this default constructor this->smile = new CipherCheshire(); this->smile->cipher_alpha = "abcdefghijklmnopqrstuvwxyz"; } /* This constructor initiates the object with a input cipher key */ Cipher::Cipher(string cipher_alpha) { // TODO: Implement this constructor if (is_valid_alpha(cipher_alpha)) { this->smile - new CipherCheshire(); this->smile->cipher_alpha = cipher_alpha; } else { cout << "Invalid alpha" << endl; exit(EXIT_FAILURE); } } /* Destructor */ Cipher::~Cipher() { // TODO: Implement this constructor delete this->smile; } /* This member function encrypts the input text using the intialized cipher key */ string Cipher::encrypt(string raw) { cout << "Encrypting..."; string retStr = ""; int length = raw.length(); int pos; string alph = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < length; i++) { if (raw[i] == ' ') { retStr += ' '; } else { pos = find_pos(smile->cipher_alpha, LOWER_CASE(raw[i])); if (isupper(raw[i])) { retStr += UPPER_CASE(alph[pos]); } else { retStr += alph[pos]; } } } cout << "Done" << endl; return retStr; } /* This member function decrypts the input text using the intialized cipher key */ string Cipher::decrypt(string enc) { string retStr; int length = enc.length(); int pos; string alph = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < length; i++) { if (enc[i] == ' ') { retStr += ' '; } else { pos = find_pos(smile->cipher_alpha, LOWER_CASE(enc[i])); if (isupper(enc[i])) { retStr += UPPER_CASE(alph[pos]); } else { retStr += alph[pos]; } } } cout << "Done" << endl; return retStr; } // ------------------------------------------------------- // Helper functions /* Find the character c's position in the cipher alphabet/key */ unsigned int find_pos(string alpha, char c) { unsigned int pos = 0; int i; int size = alpha.length(); // TODO: You will likely need this function. Finish it. char ch = tolower(c); for (i = 0; i < size; i++) { if (ch == alpha.at(i)) { por = i; break; } } return pos; } /* Make sure the cipher alphabet is valid - a) it must contain every letter in the alphabet b) it must contain only one of each letter c) it must be all lower case letters ALL of the above conditions must be me.