Question: Do the following( java code ) Create class Account with the following: Attributes: name balance Methods: initialize constructor withdraw(amount): it will withdraw the amount from
Do the following(java code)
- Create class Account with the following:
- Attributes:
- name
- balance
- Methods:
- initialize constructor
- withdraw(amount): it will withdraw the amount from balance
- deposit(amount): it will deposit amount into account
- closeAccount: It will withdraw all the balance.
- Attributes:
- Create Singleton class named Log:
- The Log saves all transaction in ArrayList of Strings
- Each transaction is saved in a string as follows:
- Operation amount name
- for example "Withdraw 150 Sami"
- for example "Deposit 200 Ahmad"
- Main:
- Create two objects of type Account
- deposit 150 in first account
- withdraw 50 from second account
- print the Log
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
