jwrbg

asd

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