Advertisement
IvaAnd

Scholarship

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