Programing basics exam 7 may задача 3
здравейте задачата ми гърми на 2 теста в jude и искам да попитам къде ми е грешката?
package com.company; import java.util.Scanner; public class Main { private static String repeat(String str , int count){ String result =""; for (int i = 0; i <count ; i++) { result+=str; } return result; } public static void main(String[] args) { Scanner console = new Scanner(System.in); String season = console.nextLine().toLowerCase(); String group = console.nextLine().toLowerCase(); double schuler = Double.parseDouble(console.nextLine()); double nights = Double.parseDouble(console.nextLine()); double price =0; double total=0; String sport =""; if(group.equals("boys")||group.equals("girls")){ if(season.equals("summer")){ if(group.equals("boys")){ sport="Football"; }else if(group.equals("girls")){ sport="Volleyball"; } price =15; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; } }else if(season.equals("spring")){ if(group.equals("boys")){ sport="Tennis"; }else if(group.equals("girls")){ sport="Athletics"; } price=7.2; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; } }else if(season.equals("winter")){ if(group.equals("boys")){ sport="Judo"; }else if(group.equals("girls")){ sport="Gymnastics"; } price =9.6; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; } }}else { if(season.equals("winter")){ sport="Ski"; price =10; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; } } else if(season.equals("spring")){ sport="Cycling"; price=9.5; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; }else if(season.equals("summer")){ sport="Swimming"; price =20; total=schuler*price*nights; if(schuler>=50){ total-=total*0.5; }else if(schuler>=20&&schuler<50){ total-=total*0.15; }else if(schuler>=10&&schuler<20){ total-=total*0.05; } } } } System.out.printf("%s %.2f lv.",sport,total); }}
здравей.
знам че метода е излишен, но пък и няма да пречи на програмата.
Иначе благодаря!