What answer did you get for this one?
(Again, you can use the <> "add code" button to add better-formatted Java code to your Q&A answers.)
public static double getCost(int quantity, double price){ //initalize discount rate double discountRate = 0.0; //determine how many items the user has purchased and apply the correct discount if (quantity <= 10){ discountRate = .10; } else if (quantity > 11 && quantity <= 50){ discountRate = .25; }else { discountRate = .40; } //calculate the discount amount double discountAmount = price * discountRate; //calcuate the final price double finalPrice = price - discountAmount; //return the final price return finalPrice; } }