A class Encrypt has been defined to replace only the vowels in a word by the next corresponding vowel and forms a new word, i.e. A → E, E → I, I → O, O → U and U → A. Example : Input: COMPUTER Output: CUMPATIR Some of the members of the class are given below: Class name : Encrypt Data members/instance variables : wrd: to store a word len: integer to store the length of the word newWrd: to store the encrypted word Methods/Member functions : Encrypt(): default constructor to initialize data members with legal initial values void acceptWord(): to accept a word in uppercase void freqVowCon(): finds the frequency of the vowels void nextVowel(): replaces only the vowels from the word stored in 'wrd' by the next corresponding vowel and assigns it to 'newWrd', with the remaining alphabets unchanged void disp(): displays the original word along with the encrypted word Specify the class Encrypt giving details of the constructor, void acceptWord(), void freqVowCon(), void ...
Comments
Post a Comment