Advertisement
stoyanoff

Scholarship-New

Jun 14th, 2020
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TEST {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         double income = Double.parseDouble(scan.nextLine());
  7.         double avgSuccess = Double.parseDouble(scan.nextLine());
  8.         double minWage = Double.parseDouble(scan.nextLine());
  9.         double socialScholarship = minWage * 0.35;
  10.         double excellentScholarship = avgSuccess * 25;
  11.  
  12.         if (income < minWage && avgSuccess > 4.5) {
  13.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  14.         }
  15.         if (avgSuccess >= 5.5 && excellentScholarship >= socialScholarship) {
  16.             System.out.printf("You get a scholarship for excellent results %.0f BGN",
  17.                     Math.floor(excellentScholarship));
  18.         } else if (socialScholarship > excellentScholarship && avgSuccess >= 5.5){
  19.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  20.         } else {
  21.             System.out.println("You cannot get a scholarship!");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement