Your version:
public double calculateTotal() {
double cost = getCost();
double tax = cost * TAX_RATE;
double total = cost + tax;
return total;
}
Teammate's version:
public double calculatetotal() {
double cost = getCost();
double tax = cost * TAX_RATE;
double total = cost - tax;
double discount = getDiscount(cost);
return total - discount;
}
The correctly merged code should be:
public double calculateTotal() {
double cost = getCost();
double tax = cost * TAX_RATE;
double total = cost + tax;
double discount = getDiscount(cost);
return total-discount;
}