SHARE
TWEET

Untitled

a guest Sep 20th, 2019 129 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.   public static void main(String[] args) {
  5.     Scanner input = new Scanner(System.in);
  6.     double income = Double.parseDouble(input.nextLine());
  7.     double averageGrade = Double.parseDouble(input.nextLine());
  8.     double minimumSalary = Double.parseDouble(input.nextLine());
  9.     //scholarships
  10.     double socialScholarship = 0.00;
  11.     double excellentGradeScholarship = 0.00;
  12.     // checking socialScholarship
  13.     if ((minimumSalary>income) && (averageGrade>4.5)) {
  14.       socialScholarship = minimumSalary*0.35;
  15.     }
  16.     // checking excellentGradeScholarship
  17.     if (averageGrade>=5.5) {
  18.       excellentGradeScholarship = averageGrade * 25;
  19.     }
  20.     if (socialScholarship==0 && excellentGradeScholarship==0) {
  21.       System.out.printf("You cannot get a scholarship!");
  22.     } else if (socialScholarship>0 && socialScholarship>excellentGradeScholarship) {
  23.       System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(socialScholarship));
  24.   } else {
  25.     System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(excellentGradeScholarship));
  26.   }
  27.   }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top