Scholarship:problem Java
Здравейте,
получавам следната грешка на 3 места/теста в Judge:
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
. Дава ми 81/100 и не успявам да разбера къде е грешката.Кодът,който въвеждам е:
import java.util.Scanner; public class Scholarship { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double INCOME = Double.parseDouble(scanner.nextLine()); double SCORE = Double.parseDouble(scanner.nextLine()); double MINSALARY = Double.parseDouble(scanner.nextLine()); double SOCIALSCHOLARSHIP = Math.floor(0.35 * MINSALARY); double EXCELLENTSCHOLARSHIP = Math.floor(25 * SCORE); if (SCORE < 4.5) { System.out.println("You cannot get a scholarship!"); }else if (SCORE<5.5 && INCOME>=MINSALARY){ System.out.println("You cannot get a scholarship!"); }else if (SCORE>=4.5 && INCOME<MINSALARY && SOCIALSCHOLARSHIP>EXCELLENTSCHOLARSHIP){ System.out.printf("You get a Social scholarship %.0f BGN",SOCIALSCHOLARSHIP); }else if (SCORE>=5.5 && EXCELLENTSCHOLARSHIP>=SOCIALSCHOLARSHIP){ System.out.printf("You get a scholarship for excellent results %.0f BGN", EXCELLENTSCHOLARSHIP); } } }
Благодаря, колеги.
Пробвах с варианта на Радостин и стана.
Много добро решение според мен! Благодаря