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)

  1. 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.
  2. 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"
  3. Main:
    1. Create two objects of type Account
    2. deposit 150 in first account
    3. withdraw 50 from second account
    4. print the Log

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!