todor_boichev

Untitled

Sep 22nd, 2020
131
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ConditionalStatements.Exercise;
  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.  
  9.         double income = Double.parseDouble(scanner.nextLine());
  10.         double averageGrade = Double.parseDouble(scanner.nextLine());
  11.         double minSalary = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double socialScholarship = 0.0;
  14.         double exellentScholarship = 0.0;
  15.  
  16.  
  17.         if (income < minSalary) {
  18.             if (averageGrade >= 4.5){
  19.                 socialScholarship = Math.floor(minSalary * 0.35);
  20.             }
  21.         }
  22.  
  23.         if (averageGrade >= 5.5) {
  24.             exellentScholarship = Math.floor(averageGrade * 25);
  25.         }
  26.  
  27.         if (income <= minSalary && averageGrade >= 4.5 && averageGrade < 5.5) {
  28.             System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  29.         } else if (income >= minSalary && averageGrade >= 5.5){
  30.             System.out.printf("You get a scholarship for excellent results %.0f BGN", exellentScholarship);
  31.         } else if (income < minSalary && averageGrade >= 5.5){
  32.             System.out.printf("You get a scholarship for excellent results %.0f BGN", exellentScholarship);
  33.         } else {
  34.             System.out.println("You cannot get a scholarship!");
  35.         }
  36.  
  37.     }
  38. }
  39.  
RAW Paste Data