title: If-Else Statement isn't executing correctly
body: <p>This is my code, by the way I'm not asking for a free fix I'm looking for someone to help me and explain my error. Thanks in advance!</p>
  
  <pre><code>    * Psuedocode: 
   * 1. Ask the user if they want to enter a number or if they want the computer to select a random number. 
   * 2. Based on the user selection, Ask the user for a number or generate a random number. 
   * 3. Read the number from the user (Skip the step if a random number is generated)
   * 4. Check if the number is 1 digit or 2 digit or 3 digit or 4 digit
   * 5. if it is 1 digit then check if the cube of number equals the number
   * 6. else if it is 2 digit, get the cube of first and second digits and then sum them up and check if the number is equal to the sum.
   * 7. else if it is 3 digit, get the cube of first, second and third digits and then sum them up andcheck if the number is equal to the sum.
   * 8. if it is 4 digit, get the cube of first, second, third and fourth digits and then sum them up andcheck if the number is equal to the sum.
   * 9. else tell the user that the number they have entered is not within 9999
   * 10. Print a closing message saying if the number is an Armstrong number or not. 
   * 11. Print a goodbye statement.
  </code></pre>
  
  <p>*/</p>
  
  <pre><code>   import java.util.Scanner;
     import java.util.Random;
  
      public class ArmstrongNumber {
  
         public static boolean Armstrong(int input) {
             String inputString = input + "";
         int numberOfDigits = inputString.length();
         int copyOfInput = input;
         int sum = 0;
  
         while (copyOfInput != 0) {
             int lastDigit = copyOfInput % 10;
             sum = sum + (int) Math.pow(lastDigit, numberOfDigits);
             copyOfInput = copyOfInput / 10;
         }
         if (sum == input) {
             return true;
         } else {
             return false;
         }
     }
  
         public static void main(String[] args) {
             Scanner scanner = new Scanner(System.in);
  
             System.out.print("Enter a number to check if it is an Armstrong number or generate a random number: ");
         int inputNumber = scanner.nextInt();
         int choice = 0;
         Random rand = new Random();
         if(choice == 1)
         {
                       inputNumber = scanner.nextInt();
         }
         else if(choice == 2)
         {
                       inputNumber =  rand.nextInt(9999) + 1; ;//generate a random number between 1 and 9999
         }
  
  
  
  
  
         boolean result = Armstrong(inputNumber);
         if (result) {
             System.out.println("");
             System.out.println(inputNumber + " is an Armstrong number");
         } else {
             System.out.println("");
             System.out.println(inputNumber + " is not an Armstrong number");
  
         }
         System.out.println("");
         System.out.println("Thanks for using my code. Goodbye");
     }
  }
  </code></pre>
  
  <p>The random generator method for my choices is not working. It is displaying only 1 and 2 as either armstrong number or not armstrong number but not generating a random number for choice 2</p>