Advertisement
zlatinnn

Java1-Zlatinnn

May 28th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class award {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double income = Double.parseDouble(scanner.nextLine());
  8.         double appraisement = Double.parseDouble(scanner.nextLine());
  9.         double minSalary = Double.parseDouble(scanner.nextLine());
  10.  
  11.         double socialSalary = Math.floor(0.35 * minSalary);
  12.         double successSalary = Math.floor(appraisement * 25);
  13.  
  14.         if (appraisement <= 4.5) {
  15.             System.out.println("You cannot get a scholarship!");
  16.         } else if (appraisement > 4.5 && appraisement < 5.5) {
  17.             if (income > minSalary) {
  18.                 System.out.println("You cannot get a scholarship!");
  19.             } else {
  20.                 System.out.printf("You get a Social scholarship %.0f BGN", socialSalary);
  21.             }
  22.         } else if (appraisement >= 5.5) {
  23.             if (minSalary > income) {
  24.                 double scolarship = Math.max(socialSalary, successSalary);
  25.                 if (socialSalary == successSalary) {
  26.                     System.out.printf("You get a Social scholarship %.0f BGN", scolarship);
  27.                 } else if (socialSalary == scolarship) {
  28.                     System.out.printf("You get a Social scholarship %.0f BGN", scolarship);
  29.  
  30.                 }else {
  31.                     System.out.printf("You get a Social scholarship %.0f BGN", scolarship);
  32.                 }
  33.  
  34.  
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement