Advertisement
Guest User

08. Scholarship

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