Стипендии / Scholarship
Здравейте колеги, решавах задачата за стипендии
https://softuni.bg/trainings/resources/officedocument/35391/exercise-problem-descriptions-programming-basics-with-java-october-2018/2155
и в judge ми дава 68/100.
Можете ли да ми дадете насоки за решаването и понеже тотално забих. Ето го и моето решение:
import java.util.Scanner; public class Salary { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double salary = Double.parseDouble(scan.nextLine()); double avrg = Double.parseDouble(scan.nextLine()); double minSalary = Double.parseDouble(scan.nextLine()); double stepExcel = avrg * 25; double stepSoc = minSalary * 35 / 100; if (avrg >= 5.5) { if (stepExcel > stepSoc && salary > minSalary) { System.out.printf("You get a scholarship for excellent results &.0f BGN", stepExcel); } else { System.out.printf("You get a Social scholarship %.0f BGN", stepSoc); } } else if (salary < minSalary && avrg > 4.5) { System.out.printf("You get a Social scholarship %.0f BGN", stepSoc); } else { System.out.println("You cannot get a scholarship!"); } } }