Fishing Boat
Здравейте,
От вчера търса причината Judge да не харесва решението ми на задачата и да ми дава 86/100 , ноо безуспешно.
Благодаря предварително за съдействието!
package Exercises.ConditionalStatementsAdvanced; import java.util.Scanner; public class FishingBoat { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int budget = Integer.parseInt(scan.nextLine()); String season = scan.nextLine(); int fishers = Integer.parseInt(scan.nextLine()); double total=0; switch (season){ case("Spring"): if (fishers<=6){ total=3000*0.90; }else if ( fishers<=11){ total=3000*0.85; }else { total=3000*0.75; }break; case("Summer"): case("Autumn"): if (fishers<=6){ total=4200*0.90; }else if (fishers<=11){ total=4200*0.85; }else { total=4200*0.75; }break; case("Winter"): if (fishers<=6){ total=2600*0.90; }else if (fishers<=11){ total=2600*0.85; }else { total=2600*0.75; } }if (fishers%2==0 && !season.equals("Autumn")){ total=total*0.95; } if (total<budget){ System.out.printf("Yes! You have %.2f leva left.",budget-total); }else if (total>=budget){ System.out.printf("Not enough money! You need %.2f leva.",total-budget); } } }