Example #1
0
        //The last method allows you to make withdrawals from your two accounts. Like the previous one,
        //it allows you to go back and make another selection. It also calls back to the Main Menu
        //when you close.
        public static void WithdrawMenu(Client newClient, Savings newSavings, Checking newChecking)
        {
            char withdrawMenu;

            Console.WriteLine("Please choose a or b to specify which account to withdraw from.");
            Console.WriteLine("a. From Checking account.");
            Console.WriteLine("b. From Savings account.");
            Console.WriteLine("c. Choose other transaction.");
            withdrawMenu = char.Parse(Console.ReadLine());

            if (withdrawMenu == 'a')
            {
                Console.WriteLine("How much money would you like to withdraw from your Checking account?");
                Console.WriteLine("Current balance on account:"); newChecking.GetBalance();
                Console.WriteLine("The amount to withdraw is: "); newChecking.MakeWithdrawal();
                Console.WriteLine("New balance on account: "); newChecking.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                WithdrawMenu(newClient, newSavings, newChecking);
            }
            else if (withdrawMenu == 'b')
            {
                Console.WriteLine("How much money would you like to withdraw from your Savings account?");
                Console.WriteLine("Current balance on account:"); newSavings.GetBalance();
                Console.WriteLine("The amount to withdraw is: "); newSavings.MakeWithdrawal();
                Console.WriteLine("New balance on account: "); newSavings.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                WithdrawMenu(newClient, newSavings, newChecking);
            }
            else
            {
                PrintMenu(newClient, newChecking, newSavings);
            }
        }
Example #2
0
        //This method allows you to deposit to the two different accounts,
        //it allows you to go back and make another selection. When you close out
        //of this method, it calls back to the Main Menu.
        public static void DepositMenu(Client newClient, Savings newSavings, Checking newChecking)
        {
            char depositMenu;

            Console.WriteLine("Please choose a or b to specify which account to deposit to.");
            Console.WriteLine("a. To Checking account.");
            Console.WriteLine("b. To Savings account.");
            Console.WriteLine("c. Choose other transaction.");
            depositMenu = char.Parse(Console.ReadLine());

            if (depositMenu == 'a')
            {
                Console.WriteLine("How much money would you like to deposit into your Checking account?");
                Console.WriteLine("Current balance on account: "); newChecking.GetBalance();
                Console.WriteLine("The amount to deposit is: "); newChecking.MakeDeposit();
                Console.WriteLine("New balance on account: "); newChecking.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                DepositMenu(newClient, newSavings, newChecking);
            }
            else if (depositMenu == 'b')
            {
                Console.WriteLine("How much money would you like to deposit into your Savings account?");
                Console.WriteLine("Current balance on account:"); newSavings.GetBalance();
                Console.WriteLine("The amount to deposit is: "); newSavings.MakeDeposit();
                Console.WriteLine("New balance on account: "); newSavings.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                DepositMenu(newClient, newSavings, newChecking);
            }
            else
            {
                PrintMenu(newClient, newChecking, newSavings);
            }
        }
Example #3
0
        //This method displays the Balance information for both accounts.
        //It calls back to Print Menu when you exit out of it.
        public static void BalanceMenu(Client newClient, Checking newChecking, Savings newSavings)
        {
            Console.WriteLine("Please choose a or b to specify which account you would like to view.");
            Console.WriteLine("a. Checking account balance.");
            Console.WriteLine("b. Savings account balance.");
            Console.WriteLine("c. Choose other transaction.");
            char balanceMenu = char.Parse(Console.ReadLine());

            if (balanceMenu == 'a')
            {
                newChecking.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                BalanceMenu(newClient, newChecking, newSavings);
            }
            else if (balanceMenu == 'b')
            {
                newSavings.GetBalance();
                Console.WriteLine("Press enter to choose another account.");
                Console.ReadLine();
                BalanceMenu(newClient, newChecking, newSavings);
            }
            else
            {
                PrintMenu(newClient, newChecking, newSavings);
            }
        }