Advertisement
Guest User

Untitled

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