Microsoft visual 2015 – bank account ITS 148: Visual Studio.NET I

Microsoft visual 2015 – bank account

ITS 148: Visual Studio.NET I
Semester Programming Exercise 21: Abstract Classes and Inheritance [1 point total]
Problem Statement: Update the BankAccount class to be an abstract class and create two classes
SavingAccount and CheckingAccount which are direct subclasses of BankAccount.
Update the BankAccount class to:
1) Be an “abstract” class
2) Make fields “protected” so subclasses can access them.
3) Convert the Deposit and Withdraw functions to be “abstract” (remove any code from them, the
code will be written in the subclasses)
Create SavingsAccount class (subclass) that inherits from BankAccount:
1) Have a data field of type double: _interestRate
2) Have a Property InterestRate with set and get methods.
3) Have a constructor method with the following four parameters:
string customerID, string accountNumber, decimal initialBalance, double interestRate
Assume that the interest of 0.01 is 1%; therefore, 1.0 is 100%.
4) Write the Deposit method. Interest is added whenever a deposit is made. The interest is on the
balance before the deposited amount is added.
5) Write Withdraw method.
6) Update the ToString method to include information about the interest rate.
Create CheckingAccount class (subclass) that inherits from BankAccount:
1) Have a data field of type bool: _overdraftProtection
2) Have a Property OverdraftProtection with set and get method.
3) As needed other data fields.
4) Write a constructor method with the following four parameters.
string customerID, string accountNumber, decimal initialBalance, bool overdraftProtection
Assume the amount of overdraft protection is $1000.
5) Write the Deposit method.
6) Write Withdraw method that takes into consideration of overdraft protection provided it has been
enabled.
7) Update the ToString method to include information on whether overdraft protection has been
enabled.
Use the attached, the updated BankAccount.cs file for this assignment as a starting point for the
BankAccount class.
Event Procedure: There is one event associated with Create Classes button. This event will
1. Implement the following test script for the Savings Account.
a. Create a saving account object: SavingsAccount(“0005”, “31-1000”, 1000m, 0.03)
b. Deposit 2000
c. Change interest rate to 5%
d. Deposit 1000
e. Try to deposit -1000
f. Withdraw 500
g. Try to withdraw 5000
Provide output for your test script as shown on the last page.
2. Implement the following test script for the Checking Account.
a. Create a checking account object: CheckingAccount(“0005″,”41-1000”,3000m, true)
b. Deposit 1000
c. Try to deposit -2000
d. Withdraw 4500
e. Try to withdraw 1000
f. Turn off overdraft protection
g. Try to withdraw 50
Provide output for your test script as shown on the last page.
Semester Programming Exercise 21
1. Start a new project using the Visual Studio C# template and Windows Forms Application inside your
assignment folder on your flash drive and name it SPE21.
2. Rename the default form name from Form1 to FormAbstractClasses by renaming the Form1.cs file
to FormAbstractClasses.cs through the Solution Explorer. There are no controls added.
3. Create the FormTestBankAccount form design in Visual C# that closely resembles the GUI which
appears on the last page
4. Change the label “Programmer: name” by replacing name with your real name.
5. Write the Visual C# code
a. Update the code for the BankAccount class to make it abstract.
b. Create a SavingAccount subclass of BankAccount.
c. Create a CheckingAccount subclass of BankAccount.
All three classes are separate files inside the SPE21 project.
You should use these three classes for Quiz 8.
6. Compete the Visual C# code for the FormAbstractClasses. Specifically, you need to complete the
code for the event procedure.
7. Laulima Delivery:
a. Delete the “obj” folder
b. Right click on your main project folder SPE21 and select “Send to”->”compressed”. This will
make a “SPE21.zip” file.
c. Upload your zipped file.
8. Sample output or Screenshot of Template Form: There are two images of the
“FormAbstractClasses” form containing the finished product.
Create a form with basic controls show below.
Results of running the test case scripts.

find the cost of your paper