SHARE
TWEET

Scholarship

Dido09 Sep 19th, 2019 83 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.  
  7.         double income = Double.parseDouble(scanner.nextLine());
  8.         double results = Double.parseDouble(scanner.nextLine());
  9.         double minSalary = Double.parseDouble(scanner.nextLine());
  10.         double scholarshipS = minSalary * 35 / 100;
  11.         double scholarshipE = results * 25;
  12.         if (results >= 5.5)
  13.         {
  14.             if (scholarshipE >= scholarshipS || income > minSalary)
  15.             {
  16.                 System.out.printf("You get a scholarship for excellent results %.0f BGN" + "\r\n", Math.floor(scholarshipE));
  17.             }
  18.             else
  19.             {
  20.                 System.out.printf("You get a Social scholarship %.0f BGN" + "\r\n", Math.floor(scholarshipS));
  21.             }
  22.         }
  23.         else if (income < minSalary && results > 4.5)
  24.         {
  25.             System.out.printf("You get a Social scholarship %.0f BGN" + "\r\n", Math.floor(scholarshipS));
  26.         }
  27.  
  28.         else
  29.         {
  30.             System.out.println("You cannot get a scholarship!");
  31.         }
  32.  
  33.  
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top