Fishing Boat problem
Judge ми дава 86/100 някой има ли идея къде ми е грешката ? Благодаря. import java.util.Scanner; public class Puppy { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int budget = Integer.parseInt(scanner.nextLine()); String season = scanner.nextLine(); int fishermanCount = Integer.parseInt(scanner.nextLine()); double price = 0; if (season.equals("Spring")) { price = 3000; if (fishermanCount <= 6) { price = price - price * 0.1; } else if (fishermanCount >= 7 && fishermanCount <= 11) { price = price - price * 0.15; } else if (fishermanCount >= 12) { price = price - price * 0.25; } if (fishermanCount % 2 == 0) { price = price - price * 0.05; } if (budget < price) { System.out.printf("Not enough money! You need %.2f leva.", Math.abs(price - budget)); } else if (budget > price) { System.out.printf("Yes! You have %.2f leva left.", Math.abs(price - budget)); } } else if (season.equals("Summer")) { price = 4200; if (fishermanCount <= 6) { price = price - price * 0.1; } else if (fishermanCount >= 7 && fishermanCount <= 11) { price = price - price * 0.15; } else if (fishermanCount >= 12) { price = price - price * 0.25; } if (fishermanCount % 2 == 0) { price = price - price * 0.05; } if (budget < price) { System.out.printf("Not enough money! You need %.2f leva.", Math.abs(price - budget)); } else if (budget > price) { System.out.printf("Yes! You have %.2f leva left.", Math.abs(price - budget)); } } else if (season.equals("Autumn")) { price = 4200; if (fishermanCount <= 6) { price = price - price * 0.1; } else if (fishermanCount >= 7 && fishermanCount <= 11) { price = price - price * 0.15; } else if (fishermanCount >= 12) { price = price - price * 0.25; } if (budget < price) { System.out.printf("Not enough money! You need %.2f leva.", Math.abs(price - budget)); } else if (budget > price) { System.out.printf("Yes! You have %.2f leva left.", Math.abs(price - budget)); } } else if (season.equals("Winter")) { price = 2600; if (fishermanCount <= 6) { price = price - price * 0.1; } else if (fishermanCount >= 7 && fishermanCount <= 11) { price = price - price * 0.15; } else if (fishermanCount >= 12) { price = price - price * 0.25; } if (fishermanCount % 2 == 0) { price = price - price * 0.05; } if (budget < price) { System.out.printf("Not enough money! You need %.2f leva.", Math.abs(price - budget)); } else if (budget > price) { System.out.printf("Yes! You have %.2f leva left.", Math.abs(price - budget)); } } } }