Question: What is the code? Create an Account class (Account.java) that a bank might use to represent a customer's bank account. Specification 1. Include a private

What is the code?

Create an Account class (Account.java) that a bank might use to represent a customer's bank account.

Specification

1. Include a private variable of type int to represent the account balance.

2. Provide a constructor that has a parameter for initial balance and uses it to initialize the account balance.

3. Provide 3 member functions:

credit - adds an amount passed as an argument to the current balance.

debit - withdraws an amount passed as an argument from the current balance.

getBalance - returns the balance amount.

4. Create a program (AccountTest.java) that creates two Account objects and validate the methods of the class Account. (Call the methods passing the appropriate values to make sure they produce the expected results.)

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!