Deiancom

toCvetanScholarship

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