public static void Main(string[] args) { // Create a bank account and display it. BankAccount ba = new BankAccount(); ba.InitBankAccount(100M); // M suffix indicates decimal. ba.Deposit(100M); Console.WriteLine("Account {0}", ba.ToBankAccountString()); // Now a savings account. SavingsAccount sa = new SavingsAccount(); sa.InitSavingsAccount(100M, 12.5M); sa.AccumulateInterest(); Console.WriteLine("Account {0}", sa.ToSavingsAccountString()); // Wait for user to acknowledge the results. Console.WriteLine("Press Enter to terminate..."); Console.Read(); }
public static void Main(string[] args) { // create a bank account and display it BankAccount ba = new BankAccount(); ba.InitBankAccount(100); DirectDeposit(ba, 100); Console.WriteLine("Account {0}", ba.ToBankAccountString()); // now a savings account SavingsAccount sa = new SavingsAccount(); sa.InitSavingsAccount(12.5M); DirectDeposit(sa, 100); sa.AccumulateInterest(); Console.WriteLine("Account {0}", sa.ToSavingsAccountString()); // wait for user to acknowledge the results Console.WriteLine("Press Enter to terminate..."); Console.Read(); }
public static void Main(string[] args) { // Create a bank account and display it. BankAccount ba = new BankAccount(); ba.InitBankAccount(100M); // M suffix indicates decimal. ba.Deposit(100M); Console.WriteLine("Account {0}", ba.ToBankAccountString()); // Now a savings account SavingsAccount sa = new SavingsAccount(); sa.InitSavingsAccount(100M, 12.5M); sa.AccumulateInterest(); Console.WriteLine("Account {0}", sa.ToSavingsAccountString()); // Wait for user to acknowledge the results. Console.WriteLine("Press Enter to terminate..."); Console.Read(); }