emodev

Scholarship

Jan 26th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1. package IzpitZadachi.c_Third;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class Scholarship {
  8.  
  9.     public static void main(String[] args) throws IOException {
  10.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  11.         double dohod = Double.parseDouble(reader.readLine());
  12.         double uspeh = Double.parseDouble(reader.readLine());
  13.         double minzaplata = Double.parseDouble(reader.readLine());
  14.  
  15.         Double socstipendia = 0.0;
  16.         Double sixstipendia = 0.0;
  17.  
  18.  
  19.         if (dohod < minzaplata) {
  20.  
  21.             if (uspeh >= 5.50) {
  22.                 sixstipendia = uspeh * 25;
  23.                 socstipendia = minzaplata * 0.35;
  24.             } else if (uspeh >= 4.50) {
  25.                 socstipendia = minzaplata * 0.35;
  26.             }
  27.  
  28.         } else {
  29.             if (uspeh >= 5.50) {
  30.                 sixstipendia = uspeh * 25;
  31.             }
  32.         }
  33.  
  34.         if (socstipendia == 0 && sixstipendia == 0) {
  35.             System.out.println("You cannot get a scholarship!");
  36.         } else if (socstipendia > sixstipendia) {
  37.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socstipendia));
  38.         } else {
  39.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(sixstipendia));
  40.         }
  41.  
  42.  
  43.     }
  44. }
Add Comment
Please, Sign In to add comment