Question: java program class First define a class BankAccount. A bank account has an instance variable balance, constructor(s), methods to add and withdraw money (deposit, withdraw),

java program class

java program class First define a class BankAccount. A bank account hasan instance variable balance, constructor(s), methods to add and withdraw money (deposit,

First define a class BankAccount. A bank account has an instance variable balance, constructor(s), methods to add and withdraw money (deposit, withdraw), a method to inquire the current balance (getBalance), a method to update the current balance (set Balance) and a method to display the current balance(printBalance): public void deposit (double amount) public void withdraw (double amount) public double getBalance) public void setBalance(double newBalance) public void printBalance () You may add some additional methods as needed Next, write a complete driver program use the functionality of the class BankAccount and name the code as proj5.java. The driver program should ask the user the initial balances first, and then displays a menu of choices d Make a deposit w Make a withdrawal s Display balances q Quit Allow the user to make any number of transactions. Of course, she/he can't withdraw display the balance automatically. A sample run from an account more money than is in the balance. When the user quits, Welcome to (your name here) bank! Please enter the balance of your bank account: 1500.00 Select one of the choices: (e.g., type 'd' or 'D' for making a deposit) d w Make a deposit Make a withdrawal s Display balances q quit Enter an amount to be deposited

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!