Dracinis999

Untitled

Sep 25th, 2020
881
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 grade = Double.parseDouble(scanner.nextLine());
  9.         double minWage = Double.parseDouble(scanner.nextLine());
  10.         double moneySocial = Math.floor(minWage*0.35);
  11.         double moneyExcellent =  Math.floor(grade*25);
  12.  
  13.         if ( grade >= 5.5){
  14.             if (moneySocial>moneyExcellent){
  15.                 System.out.printf("You get a Social scholarship %.0f BGN",moneySocial);
  16.             }
  17.             else {
  18.                 System.out.printf("You get a scholarship for excellent results %.0f BGN",moneyExcellent);
  19.             }
  20.         }
  21.         else if (grade > 4.5 && minWage>income) {
  22.             System.out.printf("You get a Social scholarship %.0f BGN",moneySocial);
  23.         }
  24.         else {
  25.             System.out.println("You cannot get a scholarship!");
  26.         }
  27.     }
  28. }
  29.  
RAW Paste Data