//******************************************************************** // Customer.java Author: Sophie Quigley // // Customer class describes customers of The Bank // //******************************************************************** public class Customer11 { public static final byte BAD_CREDIT = -1; public static final byte UNKNOWN_CREDIT = 0; public static final byte GOOD_CREDIT = 1; public static final byte EXCELLENT_CREDIT = 2; public static final boolean SHOWACCOUNTS = true; public static final boolean DONTSHOWACCOUNTS = false; private String name, phone, email; private byte rating; public Customer11 (String newname, String newphone, String newemail, byte newrating) { name = newname; phone = newphone; email = newemail; rating = newrating; } public Customer11 (String newname, String newphone, String newemail) { name = newname; phone = newphone; email = newemail; rating = UNKNOWN_CREDIT; } public Customer11 (String newname, String newphone, byte newrating) { name = newname; phone = newphone; email = ""; rating = newrating; } public Customer11 (String newname, String newphone) { name = newname; phone = newphone; email = ""; rating = UNKNOWN_CREDIT; } public void WhoAmI (boolean showaccounts) { System.out.print("Name="+name+"; Phone="+phone+"; Email="+email+"; Credit rating="); switch (rating) { case BAD_CREDIT: System.out.println("bad."); break; case UNKNOWN_CREDIT: System.out.println("unknown."); break; case GOOD_CREDIT: System.out.println("good."); break; case EXCELLENT_CREDIT: System.out.println("excellent."); break; default: System.out.println("error."); if (showaccounts) { System.out.println("with accounts:"); Account10.showaccounts(this,Account10.DONTSHOWCUSTOMER); } } public void ChangeName (String newname) { name = newname; } public void ChangePhone (String newphone) { phone = newphone; } public void ChangeEmail (String newemail) { email = newemail; } public byte Rating () { return rating; } }