Advertisement
danisun18

Scholarship

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