/**
 * This function takes a singular name as input and returns its plural form.
 *
 * @param name The singular name to be transformed into plural.
 * @return The plural form of the input name.
 */
fun getPluralName(name: String): String {

    // Identify the last character of the name
    val lastChar = name.last()

    // Check if the name ends with a vowel or consonant that undergoes changes when forming plural
    if (lastChar in listOf('o', 's', 'x', 'z') || name.takeLast(2) in listOf("sh", "ch")) {
        return name + "es"
    }

    // Check if the name ends with a consonant plus "y"
    if (name.last() == 'y' && name[name.length - 2] !in listOf('a', 'e', 'i', 'o', 'u')) {
        return name.dropLast(1) + "ies"
    }

    // Default case, just add "s" to form plural
    return name + "s"
}
/**
 * This function takes a singular name as input and returns its plural form.
 *
 * @param name The singular name to be transformed into plural.
 * @return The plural form of the input name.
 */
fun getPluralName(name: String): String {
/**
 * This function takes a singular name as input and returns its plural form.
 *
 * @param name The singular name to be transformed into plural.
 * @return The plural form of the input name.
 */
fun getPluralName(name: String): String {

    // Identify the last character of the name
    val lastChar = name.last()

    // Check if the name ends with a vowel or consonant that undergoes changes when forming plural
    if (lastChar in listOf('o', 's', 'x', 'z') || name.takeLast(2) in listOf("sh", "ch")) {
        return name + "es"
    }

    // Check if the name ends with a consonant plus "y"
    if (name.last() == 'y' && name[name.length - 2] !in listOf('a', 'e', 'i', 'o', 'u')) {
        return name.dropLast(1) + "ies"
    }

    // Default case, just add "s" to form plural
    return name + "s"
}