Advertisement
Guest User

Scholarship

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