Advertisement
vkarakolev

Untitled

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