示例#1
0
        //Changes the phase
        public void changePhase(string tempPhase)
        {
            phase    = tempPhase;
            inputted = "";
            myATMScreen.blankOut();
            switch (phase)
            {
            case "AccountNum":
                myATMScreen.setMain("Please enter your account number:");
                break;

            case "Pin":
                myATMScreen.setMain("Please enter your pin:");
                break;

            case "Options":
                myATMScreen.setMain("What would you like to do?");
                myATMScreen.setSide("Check Balance", 0);
                myATMScreen.setSide("Withdraw Cash", 1);
                myATMScreen.setSide("Exit", 2);
                break;

            case "Balance":
                myATMScreen.setMain("Your current balance is £" + account.getBalance());
                myATMScreen.setError("Please press Cancel to return to the menu");
                break;

            case "Withdraw":
                myATMScreen.setMain("How much would you like to withdraw?");
                myATMScreen.setSide("£10", 0);
                myATMScreen.setSide("£20", 1);
                myATMScreen.setSide("£50", 2);
                myATMScreen.setSide("£100", 3);
                myATMScreen.setSide("Other", 5);
                myATMScreen.setError("You can also press cancel to return to the menu");
                break;

            case "readNumber":
                myATMScreen.setMain("Enter how much you would like to withdraw.");
                myATMScreen.setError("You can also press cancel to return to the menu");
                myATMScreen.setInput(Convert.ToString(balanceInput));
                break;
            }
        }
示例#2
0
        //Changes the phase
        public void changePhase(string tempPhase)
        {
            phase    = tempPhase;
            inputted = "";
            myATMScreen.blankOut();
            switch (phase)
            {
            case "AccountNum":
                myATMScreen.setMain("Please enter your account number:");
                break;

            case "Pin":
                myATMScreen.setMain("Please enter your pin:");
                break;

            case "Options":
                myATMScreen.setMain("What would you like to do?");
                myATMScreen.setSide("Check Balance", 0);
                myATMScreen.setSide("Withdraw Cash", 1);
                myATMScreen.setSide("Exit", 2);
                break;

            case "Balance":
                myATMScreen.setMain("Your current balance is");
                //Run method to get balance for account and add it to ATMScreen
                myATMScreen.setMain("Please press Cancel to return to the menu");
                break;

            case "Withdraw":
                myATMScreen.setMain("How much would you like to withdraw?");
                myATMScreen.setSide("�", 0);
                myATMScreen.setSide("�", 1);
                myATMScreen.setSide("�", 2);
                myATMScreen.setSide("�0", 3);
                myATMScreen.setSide("Other", 5);
                myATMScreen.setError("You can also press cancel to return to the menu");
                break;
            }
        }