Advertisement
finderabc

Scholarships(java-yanuari 2019 )

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