Question: Build a DLL for a Banking application that contains an Account base class. Decide what characteristics are common for checking and saving accounts and include
Build a DLL for a Banking application that contains an Account base class. Decide what characteristics are common for checking and saving accounts and include these characteristics in the base class. Define subclasses for Checking and Savings. In your design, do not allow the banking base account to be instantiatedonly the checking and saving subclasses. Also create a Customer account such that an Account Has-a Customer. Create a simple test application that references your Banking DLL, to create customers and accounts and to perform simple transactions (withdraw, deposit).
Needs to be written in C#, This is what I have so far, need help with the program.cs, I'm lost on how to create a simple test application that references your Banking DLL, to create customers and accounts and to perform simple transactions (withdraw, deposit).
/* BankAccount.cs * This is the super (base) class for other types * of banking accounts. Checking and savings * accounts are derived from this account. * The class includes common attributes associated * with banking accounts. */
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace BankingApp { class SavingsAccount : BankAccount { // Global Varibles private decimal interestRate; private decimal minBalance; private decimal savingsBalance;
public SavingsAccount() : base() { }
public SavingsAccount(string customerLastname, string CustomerFirstName, string id, decimal intRate, decimal minimumBal, decimal thebalance) : base(customerLastname, CustomerFirstName, id) { interestRate = intRate; minBalance = minimumBal; savingsBalance = thebalance; }
internal void withdraw(int v) { throw new NotImplementedException(); }
internal void deposit(int v) { throw new NotImplementedException(); }
// Property interestRate public Decimal InterestRate { get { return interestRate; } set { interestRate = value; } }
// Property minBalance public decimal MinBalance { get { return minBalance; } set { interestRate = value; } }
// Property balance public decimal Balance { get { return savingsBalance; } set { savingsBalance = value; } }
public override string ToString() { return base.ToString() + " Savings Balance " + savingsBalance.ToString("C") + " Interest Rate: " + interestRate.ToString("P2"); }
} }
/*CheckingAcount.cs * This class extends BankAccount * by including details for checking account * customers */
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace BankingApp { class CheckingAccount : BankAccount { private bool freeChecking; private bool freeChecksProvided; private bool cancelledChecksReturned; private decimal checkingBalance; private decimal serviceCharge;
public CheckingAccount() : base() { }
public CheckingAccount(string lname, string fname, string id, bool freeCk, bool chkProv, bool cancelCks, decimal bal, decimal serviceCh) :base(lname, fname, id) { freeChecking = false; freeChecksProvided = false; checkingBalance = bal; serviceCharge = serviceCh; }
// Property freeChecking
public bool FreeChecking { get { return freeChecking; } set { freeChecking = value; } } public bool FreeChecksProvided { get { return freeChecksProvided; } set { freeChecksProvided = value; }
}
public decimal ServiceCharge { get { return serviceCharge; } set { serviceCharge = value; } }
public decimal CheckingBalance { get { return checkingBalance; } set { checkingBalance = value; } }
public bool CancelledChecksReturned { get { return CancelledChecksReturned; } set { cancelledChecksReturned = value; } }
public override string ToString() { return base.ToString() + " Checking Balance: " + checkingBalance.ToString("c") + " Monthly Service Charge: " + serviceCharge.ToString("C"); } } }
/* This class extends BankAccount * providing details regarding * savings account objects. */
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace BankingApp { class SavingsAccount : BankAccount { // Global Varibles private decimal interestRate; private decimal minBalance; private decimal savingsBalance;
public SavingsAccount() : base() { }
public SavingsAccount(string customerLastname, string CustomerFirstName, string id, decimal intRate, decimal minimumBal, decimal thebalance) : base(customerLastname, CustomerFirstName, id) { interestRate = intRate; minBalance = minimumBal; savingsBalance = thebalance; }
internal void withdraw(int v) { throw new NotImplementedException(); }
internal void deposit(int v) { throw new NotImplementedException(); }
// Property interestRate public Decimal InterestRate { get { return interestRate; } set { interestRate = value; } }
// Property minBalance public decimal MinBalance { get { return minBalance; } set { interestRate = value; } }
// Property balance public decimal Balance { get { return savingsBalance; } set { savingsBalance = value; } }
public override string ToString() { return base.ToString() + " Savings Balance " + savingsBalance.ToString("C") + " Interest Rate: " + interestRate.ToString("P2"); }
} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
