Advertisement
aneliabogeva

Scholarship

Nov 9th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BiggerNumber {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double income = Double.parseDouble(scanner.nextLine());
  7. double avarageMarks = Double.parseDouble(scanner.nextLine());
  8. double minSalary = Double.parseDouble(scanner.nextLine());
  9.  
  10. double socialBenefit = Math.floor(minSalary * 0.35);
  11. double exellentBenefit = Math.floor(avarageMarks * 25);
  12.  
  13. if(income < minSalary && avarageMarks >= 4.50){
  14. if(socialBenefit > exellentBenefit){
  15. System.out.printf("You get a Social scholarship %.0f BGN",socialBenefit);
  16. }else{
  17. System.out.printf("You get a scholarship for excellent results %.0f BGN",exellentBenefit);
  18. }
  19. }else if(income < minSalary && avarageMarks < 4.50){
  20. System.out.println("You cannot get a scholarship!");
  21. }else if(income < minSalary && avarageMarks >= 5.50){
  22. if(socialBenefit > exellentBenefit){
  23. System.out.printf("You get a Social scholarship %.0f BGN",socialBenefit);
  24. }else{
  25. System.out.printf("You get a scholarship for excellent results %.0f BGN",exellentBenefit);
  26. }
  27. }else if(income >= minSalary && avarageMarks < 4.50){
  28. System.out.println("You cannot get a scholarship!");
  29. }else if(income >= minSalary && avarageMarks >= 5.50){
  30. System.out.printf("You get a scholarship for excellent results %.0f BGN",exellentBenefit);
  31. }else if(income >= minSalary && avarageMarks >= 4.50 && avarageMarks < 5.50){
  32. System.out.println("You cannot get a scholarship!");
  33. }
  34. }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement