Unit 1 Application - 2006 FRQ
public double purchasePrice(){
double purchasePrice;
rate = 1 + taxRate;
purchasePrice = getListPrice * rate;
return purchasePrice;
}
public int compareCustomer(Customer other){
String person1_name = this.getName();
Integer person1_id = this.getID();
String person2_name = other.getName();
Integer person2_id = other.getID();
String[] names = {person1_name, person2_name};
String[] ids = {person1_id, person2_id};
Arrays.sort(names);
Arrays.sort(ids);
if (names[0] == names[1]){
return 0
}
if (names[0] == person1_name){
return -1
}
if (names[1] == person1_name){
return 1
}
}
System.out.println(stringCompare("hi", "hello"));