Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 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.  
  7. double agreements = Double.parseDouble(scanner.nextLine());
  8. double middleGoodLuck = Double.parseDouble(scanner.nextLine());
  9. double miniWorkSalary = Double.parseDouble(scanner.nextLine());
  10.  
  11. double social = 0;
  12. double exelent = 0;
  13.  
  14. if (miniWorkSalary < agreements && middleGoodLuck < 5.50) {
  15. System.out.printf("You cannot get a scholarship!");
  16. } else if (miniWorkSalary > agreements && middleGoodLuck >= 4.50) {
  17. social = 0.35 * miniWorkSalary;
  18. } else if (middleGoodLuck >= 5.50) {
  19. exelent = middleGoodLuck * 25;
  20. }
  21.  
  22. if (social > exelent) {
  23. System.out.printf("You get a Social scholarship %.0f BGN %n", Math.floor(social));
  24. }
  25. if (exelent > social){
  26. System.out.printf("You get a scholarship for excellent result %f BGN", Math.floor(exelent));
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement