I have been getting an error that says I have an else without an if and I can't figure out why. I was wondering if someone could have a look and try to help me . It's probably just something simple but I am only starting to learn so am unable to find the problem myself. Any help would be appreciated

Here's the code I'm having trouble with.
if ((totalPrice >= 20.00) && (totalPrice < 40.00)) {
discountAmount = totalPrice*DISCOUNT1;
netPrice = totalPrice - discountAmount;
System.out.printf("You have recieved a discount value of %s% yielding a discount of %S£", DISCOUNT1,discountAmount);
System.out.printf("Your final cost after the discount has been applied is %s£" , netPrice);
}
else if (totalPrice >= 40.00)
discountAmount = totalPrice*DISCOUNT1;
netPrice = totalPrice - discountAmount;
System.out.printf("You have recieved a discount value of %s% yielding a discount of %S£", DISCOUNT2,discountAmount);
System.out.printf("Your final cost after the discount has been applied is %s£" , netPrice);
else {
System.out.printf("Your total has come to %s£", totalPrice);
}