Advertisement
finderabc

Scholarship

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