import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a word: ");
String word = sc.nextLine();
int len = word.length();
char last = word.charAt(len - 1);
if (word.endsWith("ch") || word.endsWith("sh") || last == 's' || last == 'x' || last == 'z') {
System.out.println("Plural: " + word + "es");
}
else if (last == 'y' && !(word.charAt(len - 2) == 'a' || word.charAt(len - 2) == 'e' || word.charAt(len - 2) == 'i' || word.charAt(len - 2) == 'o' || word.charAt(len - 2) == 'u')) {
String newWord = word.substring(0, len - 1) + "ies";
System.out.println("Plural: " + newWord);
}
else {
System.out.println("Plural: " + word + "s");
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: