Simple Program to check a letter a Vowel or Consanant

import java.util.Scanner;

public class Vowel {

    public static void main(final String args[]){

        Scanner sc=new Scanner(System.in);
        String Letter;

        System.out.println("Enter any English Letter");
        Letter=sc.nextLine();
        sc.close();

        switch(Letter){

            case "a":
            System.out.println(Letter+" is a vowel");
            break;

            case "e":
            System.out.println(Letter+" is a vowel");
            break;

            case "i":
            System.out.println(Letter+" is a vowel");
            break;

            case "o":
            System.out.println(Letter+" is a vowel");
            break;

            case "u":
            System.out.println(Letter+" is a vowel");
            break;
            case "A":
            System.out.println(Letter+" is a vowel");
            break;

            case "E":
            System.out.println(Letter+" is a vowel");
            break;

            case "I":
            System.out.println(Letter+" is a vowel");
            break;

            case "O":
            System.out.println(Letter+" is a vowel");
            break;

            case "U":
            System.out.println(Letter+" is a vowel");
            break;

            default:
            System.out.println(Letter+" is a consanant");
        }

            
        

    }
    
}

Comments