Helena12

Scholarship

Oct 29th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Scholarship {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double income = Double.parseDouble(scanner.nextLine());
  8.         double grade = Double.parseDouble(scanner.nextLine());
  9.         double minSalary = Double.parseDouble(scanner.nextLine());
  10.  
  11.  
  12.         double socScholarship = 0;
  13.         double gradeScholarship = 0;
  14.  
  15.         if (minSalary > income) {
  16.             if (grade > 4.50) {
  17.                 socScholarship = minSalary * 0.35;
  18.             }
  19.         }
  20.  
  21.         if (grade >= 5.50) {
  22.             gradeScholarship = grade * 25;
  23.         }
  24.  
  25.         if (socScholarship > gradeScholarship) {
  26.             System.out.printf("You get a Social scholarship %.0f BGN",
  27.                     Math.floor(socScholarship));
  28.         } else if (socScholarship < gradeScholarship){
  29.             System.out.printf("You get a scholarship for excellent results %.0f BGN",
  30.                     Math.floor(gradeScholarship));
  31.         } else {
  32.             System.out.println("You cannot get a scholarship!");
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment