Advertisement
Guest User

Scholarship

a guest
Jan 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 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 averageGrade = Double.parseDouble(scanner.nextLine());
  9.         double minSalary = Double.parseDouble(scanner.nextLine());
  10.  
  11.         double socialScholarship = minSalary*0.35;
  12.         double Scholarship = averageGrade*25;
  13.  
  14.         if (averageGrade<=4.5) {
  15.             System.out.println("You cannot get a scholarship!");
  16.         }else if (averageGrade<5.5) {
  17.             if (income < minSalary) {
  18.                 System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  19.             }else {
  20.                 System.out.println("You cannot get a scholarship!");
  21.             }
  22.         }else if (averageGrade>=5.5){
  23.             if (income<minSalary) {
  24.                 if (Scholarship >= socialScholarship) {
  25.                     System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(Scholarship));
  26.                 } else {
  27.                     System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  28.                 }
  29.             }else{
  30.                 System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(Scholarship));
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement