why does this code not let me input a command after the calculator class is done?
<p>I am trying to make a simple text based operating system and I cant figure out why my code doesn't let me enter a command after the calculator class is done. It is supposed to continue executing the code until I type "off" but this is not the case. Eclipse says it is running but I cant do anything. can someone please help me?</p>

<p>here is my two classes:</p>

<pre><code>public class Calculator extends Start{

public static void calStrt() {

    System.out.print("\nEnter operator you wish to use: ");
    StringInput = scan.nextLine();

    if (StringInput.equals("+")) {

        add();

    } else if (StringInput.equals("-")) {

        sub();

    } else if (StringInput.equals("*")) {

        mul();

    } else if (StringInput.equals("/")) {

        div();

    } else {

        System.out.println("\nSyntax error: Operator not recognized");
        System.out.println("Please try again");
        calStrt();

    }

}

public static void add() {

    System.out.print("\nEnter first number: ");
    intInput = scan.nextInt();
    int intVar1 = intInput;

    System.out.print("\nEnter second number: ");
    intInput = scan.nextInt();
    int intVar2 = intInput;

    System.out.println("\nAnswer: " + (intVar1 + intVar2));

}

public static void sub() {

    System.out.print("\nEnter first number: ");
    intInput = scan.nextInt();
    int intVar1 = intInput;

    System.out.print("\nEnter second number: ");
    intInput = scan.nextInt();
    int intVar2 = intInput;

    System.out.println("\nAnswer: " + (intVar1 - intVar2));

}

public static void mul() {

    System.out.print("\nEnter first number: ");
    intInput = scan.nextInt();
    int intVar1 = intInput;

    System.out.print("\nEnter second number: ");
    intInput = scan.nextInt();
    int intVar2 = intInput;

    System.out.println("\nAnswer: " + (intVar1 * intVar2));

}

public static void div() {

    System.out.print("\nEnter first number: ");
    intInput = scan.nextInt();
    int intVar1 = intInput;

    System.out.print("\nEnter second number: ");
    intInput = scan.nextInt();
    int intVar2 = intInput;

    System.out.println("\nAnswer: " + (intVar1 / intVar2));

}

}




import java.util.Scanner;

class Start {

static Scanner scan = new Scanner(System.in);
static String StringInput;
static int intInput;

public static void main(String[] args) {

    System.out.println("\nWelcome to RobOS");

    passLoop: while (true) {

        System.out.print("\nPlease enter password: ");
        StringInput = scan.nextLine();

        if (StringInput.equals("banana")) {

            System.out.print("Logging in, please wait");
            System.out.print(".");
            System.out.print(".");
            System.out.println(".");

            System.out.println("\nWelcome User");

            outerLoop: while (true) {

                System.out.println("\nType \"help\" to see a list of programs");

                StringInput = scan.nextLine();  

                innerLoop: while (true) {

                    if (StringInput.equalsIgnoreCase("cal")) {

                        Calculator.calStrt();
                        continue outerLoop;

                    } else if (StringInput.equalsIgnoreCase("guess")) {

                        GuessGame.guess();
                        continue outerLoop;

                    } else if (StringInput.equalsIgnoreCase("help")) {

                        System.out.println("\n\"cal\" uses the calculator");
                        System.out.println("\"guess\" plays guessing game");
                        System.out.println("\"help\" shows list of programs");
                        System.out.println("\"off\" turns RobOS off");
                        continue outerLoop;

                    } else if (StringInput.equalsIgnoreCase("off")){

                        break passLoop;

                    } 

                }

            }

        } else { 

            System.out.println("\nWrong password. Please try again");
            continue passLoop;

        }

    }

}

}
</code></pre>
