Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago