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

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!