jwrbg

asd

Jan 21st, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. package com.company;
  2.  
  3.         import java.util.Scanner;
  4.  
  5. public class scholarship {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         double income = Double.parseDouble(scanner.nextLine());
  10.         double success = Double.parseDouble(scanner.nextLine());
  11.         double salary = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double socialScholarship = salary * 0.35;
  14.         double excellentScholarship = 25 * success;
  15.  
  16.  
  17.         if (success < 4.50) {
  18.             System.out.println("You cannot get a scholarship!");
  19.         }
  20.         else if(success<5.50){
  21.             if(income>salary){System.out.println("You cannot get a scholarship!");
  22.             }
  23.             else if (socialScholarship > excellentScholarship){
  24.                 System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
  25.             } else if (socialScholarship < excellentScholarship){
  26.                 System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(excellentScholarship));
  27.             }
  28.  
  29.         } else if (success >= 5.50 ) {
  30.             if (excellentScholarship >= socialScholarship) {
  31.                 System.out.printf("You get a scholarship for excellent results  " + "%.0f" + " BGN", Math.floor(excellentScholarship));
  32.             } else if (excellentScholarship <= socialScholarship) {
  33.                 System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
  34.             }
  35.         }
  36.  
  37.  
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment