Advertisement
stoyanoff

Scholarship

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