jwrbg

ZXC

Jan 21st, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.61 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.         } else if (success < 5.50){
  20.             if (income > salary) {
  21.                 System.out.println("You cannot get a scholarship!");
  22.             } else if (socialScholarship > excellentScholarship) {
  23.                 System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
  24.             } else if (socialScholarship < excellentScholarship) {
  25.                 System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(excellentScholarship));
  26.             }} else if (success >= 5.50) {
  27.                     if (excellentScholarship >= socialScholarship) {
  28.                         System.out.printf("You get a scholarship for excellent results  " + "%.0f" + " BGN", Math.floor(excellentScholarship));
  29.                     } else if (excellentScholarship <= socialScholarship) {
  30.                         System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
  31.                     }
  32.  
  33.                 }
  34.             }
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment