Advertisement
Valeri12580

Scholarship

Oct 28th, 2018
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Scholarship {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double dohod = Double.parseDouble(scanner.nextLine());
  7. double sredenUspeh = Double.parseDouble(scanner.nextLine());
  8. double minZaplata = Double.parseDouble(scanner.nextLine());
  9. double cenaSocStipendiq = Math.floor(minZaplata * 0.35);
  10. double cenaOtlStipendiq = Math.floor(sredenUspeh * 25);
  11. if (sredenUspeh<4.50 ){
  12. System.out.println("You cannot get a scholarship!");
  13. }else if (sredenUspeh>4.50 && sredenUspeh<5.50 ){
  14. if (dohod>minZaplata){
  15. System.out.println("You cannot get a scholarship!");
  16. }else {
  17. System.out.printf("You get a Social scholarship %.0f BGN",cenaSocStipendiq);
  18. }
  19.  
  20. }else if(sredenUspeh>=5.50){
  21. if (minZaplata<dohod){
  22. System.out.printf("You get a scholarship for excellent results %.0f BGN",cenaOtlStipendiq);
  23.  
  24. }else{
  25. if(cenaOtlStipendiq<=cenaSocStipendiq){
  26. System.out.printf("You get a Social scholarship %.0f BGN",cenaSocStipendiq);
  27. }else{
  28. System.out.printf("You get a scholarship for excellent results %.0f BGN",cenaOtlStipendiq);
  29. }
  30. }
  31. }
  32.  
  33.  
  34. }
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement