public class BackAccount { public double Balance { set; get; } public void Deposit(double amount) { Balance = Balance + amount; } } Transaction Fees Transaction Type Deposit Withdrawal Check Balance Amount 0.25 % of the deposit amount 0.5 % of the withdrawal amount FreeQ.1.1 Amount 0.25 % of the deposit amount 0.5 % of the withdrawal amount Free Q.1.1 Using the code snippet above, complete the bank account functionality by adding Withdraw and CheckBalance methods. In your definition for the Withdraw method, check if the account has sufficient funds before making a withdrawal. Apply transaction fees as per the table above:   Q.1.2 Using the transaction fees table and code snippet above, modify the Deposit method to include transaction fee charge. Q.1.3 Generate a UML class diagram for the class definition above. Complete Q.1.1 and Q.1.2 before completing this question. Q.1.4 Write a Unit Test class for the class used in Question 1 above. Name the unit test class “BankAccountTests”. Create a test method name “Deposit_Unit_Test” and Create an instance of the BackAccount class, make a deposit of 1000, assert that the account balance is correct. Create a test method name “Withdraw_Unit_Test” and Create an instance of the BackAccount class, make a deposit of 1000, assert that the account balance is correct. Using the same instance, make a withdrawal of 500. Assert that the account balance is updated correctly.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

public class BackAccount
{
public double Balance { set; get; }
public void Deposit(double amount)
{
Balance = Balance + amount;
} }
Transaction Fees
Transaction Type
Deposit Withdrawal Check Balance
Amount
0.25 % of the deposit amount 0.5 % of the withdrawal amount FreeQ.1.1
Amount
0.25 % of the deposit amount 0.5 % of the withdrawal amount Free
Q.1.1
Using the code snippet above, complete the bank account functionality by adding Withdraw and CheckBalance methods. In your definition for the Withdraw method, check if the account has sufficient funds before making a withdrawal. Apply transaction fees as per the table above:

 

Q.1.2
Using the transaction fees table and code snippet above, modify the Deposit method to include transaction fee charge.
Q.1.3
Generate a UML class diagram for the class definition above. Complete Q.1.1 and Q.1.2 before completing this question.
Q.1.4
Write a Unit Test class for the class used in Question 1 above. Name the unit test class “BankAccountTests”.
Create a test method name “Deposit_Unit_Test” and Create an instance of the BackAccount class, make a deposit of 1000, assert that the account balance is correct.
Create a test method name “Withdraw_Unit_Test” and Create an instance of the BackAccount class, make a deposit of 1000, assert that the account balance is correct. Using the same instance, make a withdrawal of 500. Assert that the account balance is updated correctly.

 

 

 

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY