public static void main(String[] args) {
        /*
         * My algorithm is this:
         * Step 1: I will get the input from the user.
         * Step 2: I will check if the input is one of the four valid commands.
         * Step 3: If it is a valid command, I will run the expected behavior of that command
         * Step 4: I will output the result of that command
         */

        /*************STEP 1: Get the user's input *************************/
        //I am creating an integer that will be the counter for the command no. that the user is on. Upon a successful entry it will increase by one
        int i = 1;//<-- this is our command no. counter we will initialize with integer 1
        //Now in order to get the users input, I need a scanner:
        Scanner commandReader = new Scanner(System.in); //<--I create a new Scanner object (which I also imported)
        //I am creating a boolean variable that will be used to run the while loop we will need for this program to prompt the user "Command (X):" since we don't know how many times the "Command (X):" prompt will run
        boolean programRunState = true; //<--It is set to true

        /*
        * We will enclose our statements in a large while loop as we don't know how many times we will need to prompt the
        * "Command (X):" statement.
        */
        while (programRunState) { //<-- this while loop will ensure that the "Command (X):" where X is a number is printed upon each entry unless its set to false

            //We need to let the user know that they need to enter something. So we need to print a prompt:
            System.out.println("Command (" + i + "):");//<--this is our prompt that asks the user to enter some sort of command

            //after I get the users input I will store it as a string.
            String commandEntered = commandReader.nextLine();//<--this is what the user entered in the command line

            /*************STEP 2: Check if user's input is a valid command *************************/
            /*
            * At this point we have the user's input and we will want to check if it matches a valid command:
            * monkeys[c]-good, monkeys[c]-bad, ABCMonkeys or exit
            * So we will need 4 different checks to see if the input matches a valid command

             *********** How to check if the user entered "monkeys[c]-good": ***********
             * We will need to divide the checks since [c] can be any valid character
             * We will first check if the the command entered is as long as "monkeys[c]-good"
             * Then we will check if the substrings "monkeys" and "-good" was entered
             */
            //This first if statement will check if monkeys[c]-good was entered.
            if (commandEntered.length() == 13 && commandEntered.substring(0, 7).equals("monkeys") && commandEntered.substring(8, 13).equals("-good")) {//<-- this checks if what the user entered is as long in length as "monkeys[c]-good" and if it contains the word "monkeys" and "-good"

                /*************STEP 3: If it is a valid command, I will run the expected behavior of that command *************************/

                //If the users input is "monkeys[c]-good", we will need to prompt the user for how many good monkeys to print. So we need to print a prompt:
                System.out.println("I am about to print some good monkeys. How many do you want [3 - 20]?");//<--this is our prompt asking how many good monkeys they want

                /*
                 *********** How to check if the user entered a valid integer between 3-20: ***********
                 * We will need to first check if what the user entered is an integer
                 * Then we will need to evaluate if the integer that was entered is between 3-20
                 * If the user did not enter an integer then we will need to throw the appropriate error message
                 * We will need to enclose this input validation in a while loop as we don't know how many times it will take
                 * the user to succeed.
                 */

                //A while loop is needed since we don't know how many attempts it will take the user to enter a valid integer
                while (true) {//<--This is our while loop, it is set to true and upon successful entry of an int between 3-20 it will be set to false and we can exit the loop

                    //So we first need to check if an integer was entered and proceed accordingly as the user has the liberty to enter a string as well
                    if (commandReader.hasNextInt()) {//<--this will check if what the user entered for the above prompt was an int and will return a boolean
                        //If above statement is true then we will need to store the users input of an integer so that we can evaluate it accordingly.
                        int userInputNumber = commandReader.nextInt();//I am creating a int variable that will hold the user's valid integer input.

                        //At this point we will need to evaluate if the integer entered was between 3-20
                        if (userInputNumber >= 3 && userInputNumber <= 20) {//<--this statement checks if the user entered integer between 3-20 and will return a boolean
                            //If the above boolean is set to true we will execute this loop
                            //At this point we will need to print out the specified number of monkeys between 3-20
                            //We will use a for loop to print out the correct number of monkeys as we know when the loop should end

                            /*************STEP 4: I will output the result of this command *************************/

                            /*
                             *********** How to print good monkeys: ***********
                             * We will need to first print the head of the monkey
                             * Then we will go to the next line and print the body of the monkeys
                             * Then we will go to the next line and print the legs of the monkeys
                             */
                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the head of good monkeys in a single line upto the user input
                                System.out.print(" " + commandEntered.charAt(7) + "  ");//<-- this will print out the head with specifed character in monkeys[c]-good
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the body of good monkeys in a single line upto the user input
                                System.out.print("/|\\ ");//<-- this will print out all the body in a single line
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the legs of good monkeys in a single line upto the user input
                                System.out.print("/ \\ ");//<--this will print out the legs of good monkeys in a single line
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            i++;//<--Since monkeys[c]-good was a valid command we will need to increase the command no. so the next command prompt will be Command (X+1):
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                            break;
                            //We will need to address if the user enters an input that is less than 3 and print an appropriate prompt
                        } else if (userInputNumber < 3) {//<--this will check if the user input was less than 3
                            //If the above statement is true we will need to print a prompt
                            System.out.println("This is too few monkeys. Please give an integer between 3 and 20.");//<--this is our prompt asking user to enter an integer between 3 and 20
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                            //We will need to address if the user enters an input that is greater than 20 and print an appropriate prompt
                        } else {
                            System.out.println("That is too big... We can handle up to 20 monkeys.");//<--this is our prompt asking user to enter an integer between 3 and 20
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                        }
                    }
                    //If the user didn't enter an integer we will need to display the appropriate message that includes the users non-integer input
                    else {//<--this statement will run if the user didn't enter an integer
                        //We will need to grab the users non-integer input and store it as a string
                        String userInputNonNumber = commandReader.nextLine();//<--this is what the user entered in the command line that isn't an integer
                        //We will print out the error message saying that the user didn't enter a valid integer and ask for a valid integer as a prompt
                        System.out.println("You did not enter an integer. ‘" + userInputNonNumber + "’ is not an integer. Please enter an integer [3-20].");//<--this is our prompt asking user to enter an integer between 3 and 20
                    }
                }//end of while loop that aks the user to enter an integer between 3-20 for how many good monkeys they want printed
            }//end of if statement that checks if the user entered the command monkeys[c]-good
            else if (commandEntered.length() == 12 && commandEntered.substring(0, 7).equals("monkeys") && commandEntered.substring(8, 12).equals("-bad")) {

                System.out.println("I am about to print some bad monkeys. How many do you want [3 - 20]?");

                while (true) {

                    if (commandReader.hasNextInt()) {
                        int userInputNumber = commandReader.nextInt();

                        if (userInputNumber >= 3 && userInputNumber <= 20) {
                            /*************STEP 4: I will output the result of this command *************************/

                            /*
                             *********** How to print bad monkeys: ***********
                             * We will need to first print the head of the monkey
                             * Then we will go to the next line and print the body of the monkeys
                             * Then we will go to the next line and print the legs of the monkeys
                             */

                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the head of bad monkeys in a single line upto the user input
                                if (k % 3 == 0) {//for bad monkeys we need to print a different head if the index is divisible by 3
                                    System.out.print("\\" + commandEntered.charAt(7) + "/ ");//<-- this will print out the jumping hand and head with specified character in monkeys[c]-bad
                                } else {//if not divisible by 3 then we will print out the normal head and hands
                                    System.out.print(" " + commandEntered.charAt(7) + "  ");//<-- this will print out the head with specified character in monkeys[c]-bad
                                }
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the body of bad monkeys in a single line upto the user input
                                if (k % 3 == 0) {//for bad monkeys we need to print a different body if the index is divisible by 3
                                    System.out.print(" |  ");//<-- this will print out the jumping body with specified character in monkeys[c]-bad
                                } else {//if not divisible by 3 then we will print out the normal body
                                    System.out.print("/|\\ ");//<-- this will print out the body
                                }
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            for (int k = 0; k < userInputNumber; k++) {//<--this for loop will print the legs of bad monkeys in a single line upto the user input
                                System.out.print("/ \\ ");//<--this will print out the legs of bad monkeys in a single line
                            }
                            System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                            i++;//<--Since monkeys[c]-bad was a valid command we will need to increase the command no. so the next command prompt will be Command (X+1):
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                            break;
                            //We will need to address if the user enters an input that is less than 3 and print an appropriate prompt
                        } else if (userInputNumber < 3) {//<--this will check if the user input was less than 3
                            //If the above statement is true we will need to print a prompt
                            System.out.println("This is too few monkeys. Please give an integer between 3 and 20.");//<--this is our prompt asking user to enter an integer between 3 and 20
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                            //We will need to address if the user enters an input that is greater than 20 and print an appropriate prompt
                        } else {
                            System.out.println("That is too big... We can handle up to 20 monkeys.");//<--this is our prompt asking user to enter an integer between 3 and 20
                            //We need to clear the buffer so that the error message is not printed twice
                            commandReader.nextLine();//<--this will effectively reset the scanner
                        }
                    }
                    //If the user didn't enter an integer we will need to display the appropriate message that inlcudes the users non-integer input
                    else {//<--this statement will run if the user didn't enter an integer
                        //We will need to grab the users non-integer input and store it as a string
                        String userInputNonNumber = commandReader.nextLine();//<--this is what the user entered in the command line that isn't an integer
                        //We will print out the error message saying that the user didn't enter a valid integer and ask for a valid integer as a prompt
                        System.out.println("You did not enter an integer. ‘" + userInputNonNumber + "’ is not an integer. Please enter an integer [3-20].");//<--this is our prompt asking user to enter an integer between 3 and 20
                    }
                }//end of while loop that aks the user to enter an integer between 3-20 for how many good monkeys they want printed
            }//end of if statement that checks if the user entered the command monkeys[c]-good
            /*
             * So far we have already checked whether or not the user entered monkeys[c]-good or monkeys[c]-bad as a command
             * we will now need to check address if the user entered the command "ABCMonkeys" or "exit"
             */
            else {
                //We will utilize a switch so that we can simply our code rather than using multiple if, else if and else statements
                switch (commandEntered) {//<--this switch will take in the command entered as the input, if it matches one of the cases below it will execute that case
                //If the command entered is "exit" we will run the following enclosed if and else statements
                case "exit":
                    /*
                     * When the exit command is entered, it will behave differently depending on when the command is entered
                     * If the command is entered as the first command we will print out "Leaving so soon?" and terminate the
                     * program. However if it is a the not the first command we will print "Goodbye!"
                     */
                    //So we will need to check if what command no. we are on
                    if (i == 1) {//<-- this will check if we are on the first command
                        //We will need to print out corresponding statement if the "exit" is entered as the first command
                        System.out.println("Leaving so soon?");//<--this is our print statement if the user entered exit as the first command
                        //If we are not on the first command we wil need to print out a different statement when "exit" is entered
                    } else {//<--this statement will run if we are not on the first command
                        //We will need to print out corresponding statement if the "exit" is not entered as the first command
                        System.out.println("Goodbye!");//<--this is our print statement if the user did not enter exit as the first command
                    }
                    //We will need to exit the first global while loop we intially set in either case when exit was entered
                    programRunState = false;//<--this will set the value of our global while to false and the program will end
                    break;
                //If the command entered is "ABCMonkeys" we will run the following enclosed if and else statements
                case "ABCMonkeys":
                    //We will first need to print the head of the ABCMonkeys starting from A and ending with Z

                    for (char abcMonkeyHead = 'A'; abcMonkeyHead <= 'Z'; abcMonkeyHead++) {//<--this for loop will print the head of ABCmonkeys in a single line upto the letter Z
                        System.out.print(" " + abcMonkeyHead + "  ");//<-- this will print out all the ABC heads in a single line
                    }
                    System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                    for (char abcMonkeyBody = 'A'; abcMonkeyBody <= 'Z'; abcMonkeyBody++) {//<--this for loop will print the body of ABCmonkeys in a single line upto the letter Z
                        System.out.print("/|\\ ");//<-- this will print out all the ABCMonkey body in a single line
                    }
                    System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                    for (char abcMonkeyLegs = 'A'; abcMonkeyLegs <= 'Z'; abcMonkeyLegs++) {//<--this for loop will print the legs of ABCmonkeys in a single line upto the letter Z
                        System.out.print("/ \\ ");//<-- this will print out all the ABCMonkey legs in a single line
                    }
                    System.out.println();//<--then we will need to enter a new line so we will print nothing and move to a new line
                    i++;//<--Since ABCMonkeys was a valid command we will need to increase the command no. so the next command prompt will be Command (X+1):
                    break;
                //At this point if the entered command does not match any of our checks we will need to let the user know that the entered command is not valid and print the corresponding message.
                default: System.out.println("Unknown command :" + commandEntered + ". the list of commands that I can understand is [monkeys[c]-good, monkeys[c]-bad, ABCMonkeys, exit]");//<--this will print out the error message stating that the entered command isn't one of the valid commands
                    break;
                }//end of our switch statement that checks for validation of "exit" and "ABCMonkeys" commands
            }//end of our else statement that checks for validation of user input

        }//end of while loop that prompts the user for Command (X):
        //after I get the users input I do not need the scanner to read input any more, so I can close it.
        commandReader.close();//<-- this closes the scanner we used in the program
    }//end of main method