Advertisement
Valik98

Scholarship

Sep 30th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1. package ConditionalStatements_2.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 average = Double.parseDouble(scanner.nextLine());
  11.         double minIncome = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double socSco = 0.35 * minIncome;
  14.         double uspSco = average * 25;
  15.  
  16.         if (income > minIncome && average < 5.5) {
  17.             System.out.println("You cannot get a scholarship!");
  18.         } else if (income < minIncome && average < 4.5) {
  19.             System.out.println("You cannot get a scholarship!");
  20.         } else if (income < minIncome && average >= 4.5 && average <= 5.5) {
  21.             System.out.printf("You get a Social scholarship %.0f BGN", socSco);
  22.         } else if (income < minIncome && average >= 4.5 && socSco > uspSco) {
  23.             System.out.printf("You get a Social scholarship %.0f BGN", socSco);
  24.         } else if (income < minIncome && average >= 5.5 && uspSco > socSco) {
  25.             System.out.printf("You get a scholarship for excellent results %.0f BGN", uspSco);
  26.         } else if (income >= minIncome && average >= 5.5) {
  27.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(uspSco));
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement