Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.  
  10.         double income = Double.parseDouble(scanner.nextLine());
  11.         double grade = Double.parseDouble(scanner.nextLine());
  12.         double minWage = Double.parseDouble(scanner.nextLine());
  13.  
  14.         boolean socialScholarship = income < minWage && grade > 4.5;
  15.         double socialScholarshipMoney = Math.floor(minWage * 0.35);
  16.         boolean excellenceScholarship = grade >= 5.5;
  17.         double excellenceScholarshipMoney = Math.floor(grade * 25);
  18.  
  19.         if (socialScholarship && socialScholarshipMoney > excellenceScholarshipMoney) {
  20.             System.out.printf("You get a Social scholarship %.0f BGN", socialScholarshipMoney);
  21.         } else if (excellenceScholarship && excellenceScholarshipMoney >= socialScholarshipMoney) {
  22.             System.out.printf("You get a scholarship for excellent results %.0f BGN", excellenceScholarshipMoney);
  23.         } else if (socialScholarship && excellenceScholarship && socialScholarshipMoney > excellenceScholarshipMoney) {
  24.             System.out.printf("You get a Social scholarship %.0f BGN", socialScholarshipMoney);
  25.         } else if (socialScholarship && excellenceScholarship && excellenceScholarshipMoney >= socialScholarshipMoney) {
  26.             System.out.printf("You get a scholarship for excellent results %.0f BGN", excellenceScholarshipMoney);
  27.         } else {
  28.             System.out.println("You cannot get a scholarship!");
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement