Advertisement
finderabc

Scholarship

Jun 24th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. package ExamExercisesVol2;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class Scholarship {
  8.     public static void main(String[] args) throws IOException {
  9.         BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
  10.  
  11.         double income = Double.parseDouble(scan.readLine());
  12.         double grade = Double.parseDouble(scan.readLine());
  13.         double minPay = Double.parseDouble(scan.readLine());
  14.  
  15.         double scholarshipSocial = minPay * 0.35;
  16.         double scholarshipGrade = grade * 25;
  17.  
  18.  
  19.         if (grade < 4.50) {
  20.             System.out.println("You cannot get a scholarship!");
  21.  
  22.         } else if (grade < 5.50 & income < minPay) {
  23.  
  24.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(scholarshipSocial));
  25.  
  26.         } else if (income < minPay) {
  27.  
  28.             double sClr = Math.max(scholarshipSocial, scholarshipGrade);
  29.  
  30.             if (sClr == scholarshipGrade) {
  31.                 System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(sClr));
  32.  
  33.             } else if (sClr == scholarshipSocial) {
  34.                 System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(sClr));
  35.  
  36.             }
  37.         } else if (grade >= 5.50){
  38.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarshipGrade));
  39.  
  40.                 }else
  41.                  System.out.println("You cannot get a scholarship!");
  42.             }
  43.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement