Advertisement
Deiancom

toDessy

Jan 20th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. package Dcom;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Scholarship {
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         double income = Double.parseDouble(scan.nextLine());
  9.         double grade = Double.parseDouble(scan.nextLine());
  10.         double minimumWage = Double.parseDouble(scan.nextLine());
  11.         double socialScholarship = 0.35 * minimumWage;
  12.         double scholarship = grade * 25;
  13.         boolean social = false;
  14.  
  15.         if (income < minimumWage && grade > 4.50) {
  16.             social = true;
  17.         }
  18.         if (social && grade >= 5.50) {
  19.             if (socialScholarship > scholarship) {
  20.                 System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  21.             } else {
  22.                 System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
  23.             }
  24.         } else if (social) {
  25.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  26.         } else if (grade >= 5.5) {
  27.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
  28.         } else {
  29.             System.out.println("You cannot get a scholarship!");
  30.  
  31.         }
  32.     }
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement