Advertisement
RGeorgiev97

Scholarship

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