Advertisement
SvetlanPetrova

Scholarship

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