Facebook
From az, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 39
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         Scanner console = new Scanner(System.in);
  9.         double income = console.nextDouble();
  10.         double score = console.nextDouble();
  11.         double minimumSalary = console.nextDouble();
  12.         double scholarship = score * 25;
  13.         double socialScholarship = minimumSalary * 0.35;
  14.  
  15.  
  16.         if(income <= minimumSalary && score >=5.5){
  17.             if(scholarship < socialScholarship){
  18.                 System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(socialScholarship));
  19.             }else{
  20.                 System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(scholarship));
  21.             }
  22.         }else if(score >=5.5){
  23.             System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(scholarship));
  24.         }else if (income <= minimumSalary && score > 4.5){
  25.             System.out.printf("You get a Social scholarship %.2f BGN",Math.floor(socialScholarship));
  26.         }else{
  27.             System.out.println("You cannot get a scholarship!");
  28.         }
  29.         }
  30. }