using System; namespace Assignment_1B { public class Account { // To do - declare all class data members as properties (ID, Name and Value public int ID { get; set; } public string Name { get; set; } public double Value { get; set; } = 0.0; public virtual void Deposit(double amount) { Value += amount; } public virtual void Withdraw(double amount) { Value -= amount; } } public class SavingsAccount : Account { public double InterestRate { get; set; } public void MonthEnd() { Value += Value * InterestRate; } } public class CheckingAccount : Account { public int TransactionLimit { get; set; } public int TransactionCount { get; private set; } public double TransactionFee { get; set; } public double AccountFee { get; set; } public override void Deposit(double amount) { Value += amount; } public override void Withdraw(double amount) { Value -= amount; } private void UpdateTransectionCount() { Value = TransactionLimit - TransactionCount; } public void MonthEnd() { Value = Value - ((TransactionLimit * TransactionFee)+AccountFee); } } class Program { static void Main(string[] args) { var mySavingsAccount = new SavingsAccount { ID = 5, Name = "My Savings Account", InterestRate = 0.01 }; mySavingsAccount.Deposit(100.0); mySavingsAccount.Withdraw(20.0); Console.WriteLine("Current Balance after all transections (Savings Account): " + mySavingsAccount.Value); mySavingsAccount.MonthEnd(); Console.WriteLine("Balance after month end (Savings Account): " + mySavingsAccount.Value); var myCheckingAccount = new CheckingAccount { ID = 7, Name = "My Checking Account", TransactionLimit = 2, TransactionFee = 1.5, AccountFee = 5.0 }; myCheckingAccount.Deposit(100.0); myCheckingAccount.Withdraw(10.0); myCheckingAccount.Withdraw(10.0); myCheckingAccount.Withdraw(10.0); myCheckingAccount.Deposit(100.0); myCheckingAccount.Withdraw(20.0); Console.WriteLine("Current Balance after all transections (Checking Account): " + myCheckingAccount.Value); myCheckingAccount.MonthEnd(); Console.WriteLine("Balance after month end (Checking Account):" + myCheckingAccount.Value); } } }