Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Scholarship {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. double income = Double.parseDouble(scanner.nextLine());
  10. double achievement = Double.parseDouble(scanner.nextLine());
  11. double mrz = Double.parseDouble(scanner.nextLine());
  12.  
  13. double socialScholarship = 0.0;
  14. double achievementsScholarship = 0.0;
  15.  
  16. if (achievement >= 5.5) {
  17. achievementsScholarship = achievement * 25;
  18. }
  19. if (achievement > 4.5) {
  20. if (income < mrz) {
  21. socialScholarship = mrz * 0.35;
  22. }
  23. }
  24. if (socialScholarship + achievementsScholarship == 0.0) {
  25. System.out.println("You cannot get a scholarship!");
  26. } else if (socialScholarship > achievementsScholarship) {
  27. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  28. } else {
  29. System.out.printf("You get a scholarship for excellent results %.0f BGN", achievementsScholarship);
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement