Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. package Ex2;
  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 grades = Double.parseDouble(scanner.nextLine());
  11.         double minSalary = Double.parseDouble(scanner.nextLine());
  12.  
  13.         if (income > minSalary && grades < 5.5) {
  14.             System.out.println("You cannot get a scholarship!");
  15.         } else if (income < minSalary && grades > 4.5) {
  16.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(0.35 * minSalary));
  17.         } else if (grades >= 5.50) {
  18.             System.out.printf("You get a scholarship for excellent results", grades * 25);
  19.         }
  20.     }
  21.  
  22.  
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement