BANK ACCOUNT
Part A:
Create file Account.java. File Account.java contains a class representing a bank account similar (Note that the constructor generates the account number randomly.) Save this file to your directory and use it in Part B. Class Account allows deposit, withdraw, and inquire. This class contains:
• Constructor: initialize account information (ex. A/C name and A/C number) and account balance.
• Withdraw method: deducts amount from current balance.
• Deposit method: adds amount to current balance.
• Inquiry method: returns current balance.
• ToString method: returns account information in a nice string. Example: Name: "Account Name" Balance: "Account Balance" Account Number: "Account Number."
• Number of Account method: returns the total number of accounts.
Requirement:
a. Use Random function to create account number. Random Function: Math.random().
b. Withdraw method -- Deducting amount from balance, if balance doesn't cover withdrawal, prints message "insufficient funds" and does not change the balance.
c. Suppose the bank wants to keep track of how many accounts exist.
Declare a private static integer variable numAccounts to hold this value. It will automatically be initialized to 0.
o Add code to the constructor to increment this variable every time an account is created.
o Add a static method numAccounts that returns the total number of accounts. (Think about why this method should be static -- its information is not related to any particular account.)
Part B:
Create file AccountTest.java to test Account.java follow on the following requirements:
a. Create a new account from Account.java. The account name is " Mike" and initial balance is 500.
b. Get Account information.
c. Deposit an amount of 500 to Mike account and inquire new balance.
d. Create a new account from Account.java. The account name is " Susan" and initial balance is 100.
e. Withdraw an amount of 50 from Susan account and inquire new balance.
f. Withdraw another amount of 70 from Susan account. (You should get message insufficient funds at this point.)
g. Returns the total number of accounts.
VERY IMPORTANT DOCUMENTATION THAT IS NECCESARY!!!
• Documentation of the project, containing the algorithm, produced in pseudocode or flowchart, as well as the UML diagram representing the class structure of the program.
• Detailed instructions on how to use the program and its intricacies.