/**
 * Build switch statement
 */

public class Switch
{
    public static void main(String[ ] args)
    {
        if (args.length == 0)                       //if no prameters are entered
        {
            System.out.println("Please enter 'yes' or 'no' on the command line");
            System.exit(0);
        }
        String param = args[0];                     //get param from 1st argument
        char input   = param.charAt(0);             //convert string to char

        switch(input)                                           //check the input variable
        {
            case 'y':                                           //if y
            case 'Y':                                           //or Y
                System.out.println("You entered yes");
                System.out.println("Thank you for confirming");
                break;                              
            case 'n':                                           //if n
            case 'N':                                           //or N
                System.out.println("You entered no");                              
                System.out.println("Cancelling your request");
                break;                              
            default:                                            //otherwise
                System.out.println("Please enter 'y' or 'n'");
        }                               
    }
}