Example #1
0
        static void Main(string[] args)
        {
            const decimal OPENING_BALANCE  = 55m;
            const decimal MONTHLY_INTEREST = 0.0033m;

            //add monthly interest to savings account and display balance
            Savings savings = new Savings(OPENING_BALANCE);

            savings.AddMonthlyInterest(MONTHLY_INTEREST);
            savings.ShowBalance();

            //deduct the monthly check fee from the account balance and display balance
            Checking checking = new Checking(OPENING_BALANCE);

            checking.DeductServiceCharge();
            checking.ShowBalance();

            //show the 2 owners of the joint account, plus add interest to the balance and display the balance
            JointSavings jointSavings = new JointSavings("Bob", "Martha", OPENING_BALANCE);

            jointSavings.ShowOwners();
            jointSavings.AddMonthlyInterest(MONTHLY_INTEREST);
            jointSavings.ShowBalance();
            Console.ReadKey();
        }