Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 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 pay = Double.parseDouble(scanner.nextLine());
  7. double grade = Double.parseDouble(scanner.nextLine());
  8. double minWage = Double.parseDouble(scanner.nextLine());
  9. double bScholarship = 0;
  10. double aScholarship = 0;
  11. if (grade > 4.5) {
  12. if (pay < minWage) {
  13. bScholarship = minWage * 0.35;
  14. } if (grade >= 5.5) {
  15. aScholarship = grade * 25;
  16. if (aScholarship >= bScholarship) {
  17. System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(aScholarship));
  18. }
  19. }
  20. }
  21. if (bScholarship != 0) {
  22. if (bScholarship > aScholarship) {
  23. System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(bScholarship));
  24. }
  25. } else {
  26. if (aScholarship == 0) {
  27. System.out.println("You cannot get a scholarship!");
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement