Advertisement
Dessy_k

Untitled

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