Guest User

Untitled

a guest
Jun 6th, 2020
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         double income = Double.parseDouble(scanner.nextLine());
  7.         double averageSuccess = Double.parseDouble(scanner.nextLine());
  8.         double minSalary = Double.parseDouble(scanner.nextLine());
  9.         double socialScholarship = minSalary * 0.35;
  10.         double excellentScholarship = averageSuccess * 25;
  11.  
  12.         if (averageSuccess >= 5.5) {
  13.             if (socialScholarship > excellentScholarship) {
  14.                 System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  15.             } else {
  16.                 System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(excellentScholarship));
  17.             }
  18.         }else if(averageSuccess >= 4.5 && income <= minSalary){
  19.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  20.         }else{
  21.             System.out.println("You cannot get a scholarship!");
  22.         }
  23.     }
  24.  
  25. }
RAW Paste Data