[SOLVED] Class Account

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Account.zip (8.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)
Create a class called Account that contains:

Three private instance variables: name (String), account (String), account balance (double).

One constructor, which constructs all instances with the values given.

Getters and setters for all the instance variables.

Debit function that takes an amount from the user and subtract the balance (make sure the balance will not drop below zero after the operation, if this was the case, the function should return false else it should return true)

Credit function that takes an amount from the user and add it to the balance.

Write a test program called TestAccount to test the constructor and public methods in the class Account. Ask the user to enter the information for four accounts and create them, then allow the user to choose the operation that he wants on those accounts. Operations are Show balance or Debit or Credit, if he chose debit or credit ask him to specify the amount, in case of debit if the amount is not sufficient tell him “insufficient amount.

  • Account.zip