First you add the three static variables as instructed:
private static double price;
private static int discountRate;
private static double tax;
Then you implement the sale() method:
public static double sale(){
System.out.printf("Price before discount: %.2f\n", price);
double sale = price * (1-(double)discountRate/100.0);
System.out.printf("Price after discounting %d%% but before tax: %.2f\n", discountRate, sale);
sale *= (1+tax/100.0);
System.out.printf("Discounted price with %.1f%% tax added: %.2f\n", tax, sale);
return sale;
}
I kind of took a stab at how to calculate the sale. Not sure if the tax has to be added before or after the discount. But I'm sure you can fix that if needed.