Answers for "accept the noun and the output of plural c++"

C++
0

accept the noun and the output of plural c++

noun = getnoun();

// case a/b?
if (lastletterof(noun)=='y')
{ 
   if (isconsonant(onebutlastletter(noun)) 
   {
      // case a!
      plural = noun - lastletter;
      plural = plural + "ies" 
   }
   else
   {
      // case b!
      plural = noun + "s" 
   }
}
else 
{
    // noun is not case not a or b, so test for c, d.
}
output plural;

<div class="open_grepper_editor" title="Edit & Save To Grepper"></div>
Posted by: Guest on June-01-2020

Code answers related to "accept the noun and the output of plural c++"

Browse Popular Code Answers by Language