SHARE
TWEET

Untitled

mihaellan Nov 19th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Scholarship {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.  
  7.         double income = sc.nextDouble();
  8.         double averageGrades = sc.nextDouble();
  9.         double minimalWage = sc.nextDouble();
  10.  
  11.         double socialScholarship = 0;
  12.         double excellentNotesScholarship = 0;
  13.  
  14.         if (income < minimalWage && averageGrades > 4.5) {
  15.             socialScholarship = Math.floor(0.35 * minimalWage);
  16.         }
  17.  
  18.         if (averageGrades >= 5.5) {
  19.              excellentNotesScholarship = Math.floor(averageGrades * 25);
  20.         }
  21.  
  22.         if (socialScholarship > excellentNotesScholarship) {
  23.             System.out.println("You get a Social scholarship " + (int) socialScholarship + " BGN");
  24.         } else if (excellentNotesScholarship > socialScholarship) {
  25.             System.out.println("You get a scholarship for excellent results " + (int) excellentNotesScholarship + " BGN");
  26.         } else {
  27.             System.out.println("You cannot get a scholarship!");
  28.         }
  29.  
  30.     }
  31. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top