//This code defines a LoanOfficer class
public class LoanOfficer
{
//This field stores the LoanOfficer's ID
private int officerID;
//This field stores the current customer the Loan Officer is serving
private Customer currentCustomer;
//This constructor sets the officerID and currentCustomer to null
public LoanOfficer(int id)
{
this.officerID = id;
currentCustomer = null;
}
//This method returns the LoanOfficer's ID
public int getID()
{
return officerID;
}
//This method returns true if the LoanOfficer is currently serving a customer
public boolean hasCustomer()
{
if(currentCustomer != null) {
return true;
}
else{
return false;
}
}
//This method assigns a new cutomer to the Loan Officer
public boolean assignCustomer(Customer customer1)
{
if (currentCustomer == null)
{
currentCustomer = customer1;
return true;
}
else
{
return false;
}
}
//This method returns the current customer and sets currentCustomer to null
public Customer handleCustomer()
{
Customer X=null;
if (currentCustomer != null) {
Lo
// Name: Kathan Parag Shah
// StudentID: 1225611244
// Lecture: T TH 4:30pm
// Description: anOfficer class represents a bank loan officer
// that accept/handle and release customers.
// //---- is where you should add your own code
// Assignment #: ASU CSE205 Spring 2023 #10
X = currentCustomer;
currentCustomer = null;
return X;
}
else {
X = null;
}
return X;
}
//This method returns a string representation of the LoanOfficer's ID and current
customer
public String toString()
{
String result = "\nOfficer ID: " + officerID;
if (currentCustomer == null)
result += " does not have any cutomers\n";
else
result += " is serving customer with id " + currentCustomer.getCustID() +
"\n";
return result;
}
}
Powered by TCPDF (www.tcpdf.org)