Advertisement
SIRAKOV4444

Untitled

Mar 29th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1.  
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Exe2 {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9.  
  10. double income=Double.parseDouble(scanner.nextLine()); //dohod v leva
  11. double grade=Double.parseDouble(scanner.nextLine()); //sreden uspeh
  12. double minimumWage=Double.parseDouble(scanner.nextLine()); //minimalna zaplata
  13.  
  14. double money=0.0;
  15. double excellence=0.0;
  16.  
  17.  
  18. if(minimumWage<income && grade>4.5) { //do tuk dobre
  19. money = minimumWage*0.35;
  20. }
  21. if(grade>=5.5) {
  22. excellence = grade*25;
  23. }
  24.  
  25. if(money == 0 && excellence == 0) {
  26. System.out.println("You cannot get a scholarship!"); //ok
  27. } else if (money !=0 && money>excellence) {
  28. System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(money));
  29. } else if (excellence !=0 && excellence>=money){
  30. System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(excellence));
  31.  
  32.  
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement