aneliabogeva

Scholarship

Nov 9th, 2020
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×