Advertisement
CoineTre

Scholarships

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