Answered step by step
Verified Expert Solution
Question
1 Approved Answer
must be written in java and work with the following classes. thank you. This is BankAccount test class Public class BankTester { //your code here
must be written in java and work with the following classes. thank you.
This is BankAccount test class
Public class BankTester {
//your code here
}
This is the BankAccount Class
Should not be changed
Public class BankAccount {
private double balance;
private String name;
private int acctNumber;
public BankAccount (String initName , int acct )
{
name=initName;
acctNumber=acct;
balance=0.0;
}
public void deposit(double amt)
{
balance=balance+amt;
}
public void withdraw(double amt)
{
balance=balance-amt;
}
public double getBalance()
{
return balance;
}
}
Write a BankAccountTester class whose main method constructs a bank account, deposits $1,000, withdraws $500, withdraws another $400, and then prints the remaining balance. Also print the expected resultStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started