Advertisement
la-ma-rin

Scholarship3

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