nouns

Jan 18, 2012 at 6:29am
guys can you help me how to validate if the letter is in the last because when i put the letters y, s, ch, sh anywhere in a word it just change.


a. if noun ends in "y" remove the "y" and add "ies"
b. if noun ends in "s", "ch", "sh" add "es"
c. in all other cases, just add "s".

sample output:

enter singular noun: butterfy
plural noun: butterflies
Jan 18, 2012 at 7:58am
Look into substrings
Jan 18, 2012 at 10:13am
this mite help

1
2
3
4
   //This will get you the last character of the string
   string str;
   int pos = str.length() - 1;
   str.substr(pos);
Last edited on Jan 18, 2012 at 10:14am
Jan 18, 2012 at 1:16pm
Topic archived. No new replies allowed.