deyanivanov966

08. Scholarship

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