Advertisement
jwrbg

asd

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