Question: How would you code this out? Can you also add in comments to explain your logic at each part. Thank you. In this project you



How would you code this out? Can you also add in comments to explain your logic at each part. Thank you.
In this project you will be developing a class library for account classes that can be used to create two types of bank accounts. For example, user could use this library of classes to deposit and withdraw money from bank account as well as see the account balance. This set of classes will include Account Savings, and Checking. Think about the following scenario: A bank determines that there are two specific kinds of bank accounts. Savings accounts have a customer id, balance, interest rate, and overdraft amount. A customer can withdraw an amount of money from the account, but only if they don't go over the overdraft amount. For example, if the balance is $100 and the overdraft is $200, the customer can withdraw no more than $300. The customer can also deposit an amount of money to the account. An interest amount is added to savings account after certain period (For this project do not think about time, just think about the task). A Checking account has a customer id, balance, and transfer fee. A customer can withdraw an amount of money from the account, but they can't withdraw more than the current balance. The customer can also deposit an amount of money to the account. Also, every time a withdraw is done from checking account, a transaction fee is applied for it. Notes: . Data members Data members' details are as follows (it is up to you to decide what member goes in which class): customer id (int type): identification number for the customer. Default value 0. balance ( double type): keep the balance amount of the account. Default value is 0. interest rate (double type): defines the interest rate which is used to calculate the interest amount on balance of Savings account. (Think about interest is added with the Savings account balance at the end of each month. For this project, you do not need to check whether it is at the add of month. Just have option to add interest with Savings account balance when user want to add it). Default value is 0. overdraft (double type): Overdraft amount specify the limit that can be withdrawn from account if the balance is zero or less than the required amount. Default value is 0. transaction Fee (double type): is the charge applied for each withdrawal from checking account. Default value is 0. 1 Constructors Each class should have one default constructor and another constructor with required parameters. Methods: All data members defined in a class require accessor and mutator methods. Mutator methods must throw the appropriate exception object with concise and informative error messages (For example, trying to create account with negative balance). If not using any acceesor/mutator for a data member then explain that in the documentation. deposit() method is used to deposit amount (passed as argument) in the account. In other words, amount will be added to balance. This method returns nothing. withdraw() method is the abstract method in abstract class 'Account which need to be overridden in each of the subclass. This method withdraws money from account and update the balance. The asked amount would be passed as argument. If withdrawal is not possible then throw exception to show proper message. It returns nothing. addInterest() method: add interest with the current balance. Amount of interest can be calculated using following formula: interest=current balance*interest rate No return. toString method(): Savings and Checking class should have string representation which return the account name and balance. Your classes must be related as depicted in the diagram below: Account Savings Checking Testing your Library You should test your library to make sure it functions perfectly. Create a JAR file of your library (you'll need to submit this anyway) and add it to a new project (Tester) in NetBeans. Add some code to test each of your three classes and all of their methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
