Question
This is my program if anything is off lmk. public class Customer { private String firstName; private String lastName; private String accountNumber; private String accountBalance;
This is my program if anything is off lmk.
public class Customer {
private String firstName;
private String lastName;
private String accountNumber;
private String accountBalance;
//Constructors
public Customer(String fname, String lname)
{
firstName = fname;
lastName = lname;
}
public Customer(String fname, String lname, String accNum, double bal)
{
firstName = fname;
lastName = lname;
accountNumber = accNum;
accountBalance = bal;
}
// instance methods
public void setfirstName(String fname)
{ firstName = fname; }
public String getfirstName()
{ return firstName; }
public void setCustomer(String cust)
{ return customer; }
public void deposit(double amount)
{ accountBalance += amount; }
public boolean equals(String acctnum)
{ return accountNumber.equals(acctnum); }
public int CompareTo(Customer other)
{ int x = this.lastName.compareTo(other.lastName);
if(x!=0) return x;
x= this.lastName.compareTo(other.lastName);
if(x!=0) return x;
return(this.accountNumber).compareTo(other.accountNumber);
}
I need help writing a tester for the program above. I only need one customer.
Java
1. Find a customers account by account number for deposits and withdrawals. 2. Find a customers account by searching for the customers name. 3. Deposit into an account, and show the new balance. 4. Withdraw from an account and show the new balance, if there is enough money! 5. Display a selected customers information. 6. Display all of the customers.
Step 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