Advertisement
Guest User

Word in Plural

a guest
Sep 21st, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. class wordInPlural
  4. {
  5.     static void Main()
  6.     {
  7.         string noun = Console.ReadLine();
  8.         string plural = null;
  9.         if (noun.EndsWith("y"))
  10.         {
  11.             plural = noun.Replace("y", "ies");
  12.             Console.WriteLine(plural);
  13.         }
  14.         else if (noun.EndsWith("o") || noun.EndsWith("ch") || noun.EndsWith("s") || noun.EndsWith("x")|| noun.EndsWith("z"))
  15.         {
  16.            
  17.             noun = noun + "es";
  18.             Console.WriteLine(noun);
  19.         }
  20.         else
  21.         {
  22.             noun = noun + "s";
  23.             Console.WriteLine(noun);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement