Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.   public static void main(String[] args) {
  5.     Scanner input = new Scanner(System.in);
  6.     double income = Double.parseDouble(input.nextLine());
  7.     double averageGrade = Double.parseDouble(input.nextLine());
  8.     double minimumSalary = Double.parseDouble(input.nextLine());
  9.     //scholarships
  10.     double socialScholarship = 0.00;
  11.     double excellentGradeScholarship = 0.00;
  12.     // checking socialScholarship
  13.     if ((minimumSalary>income) && (averageGrade>4.5)) {
  14.       socialScholarship = minimumSalary*0.35;
  15.     }
  16.     // checking excellentGradeScholarship
  17.     if (averageGrade>=5.5) {
  18.       excellentGradeScholarship = averageGrade * 25;
  19.     }
  20.     if (socialScholarship==0 && excellentGradeScholarship==0) {
  21.       System.out.printf("You cannot get a scholarship!");
  22.     } else if (socialScholarship>0 && socialScholarship>excellentGradeScholarship) {
  23.       System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(socialScholarship));
  24.   } else {
  25.     System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(excellentGradeScholarship));
  26.   }
  27.   }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement