Advertisement
lexxandras

Untitled

Mar 29th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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 salary = Double.parseDouble(scan.nextLine());
  7. double mark = Double.parseDouble(scan.nextLine());
  8. double minSalary = Double.parseDouble(scan.nextLine());
  9.  
  10. double socialScholarship = minSalary * 0.35;
  11. double excellentScholarship = mark * 25;
  12.  
  13. if (mark < 4.50) {
  14. System.out.println("You cannot get a scholarship!");
  15. }
  16. else if( mark >= 4.50){
  17. if (salary > minSalary){
  18. System.out.println("You cannot get a scholarship!");
  19. } else if ( salary < minSalary){
  20. socialScholarship = minSalary * 0.35;
  21. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  22. }
  23. } else if (mark >= 5.50) {
  24. if (salary > minSalary) {
  25. System.out.println("You cannot get a scholarship!");
  26. } else if (salary < minSalary) {
  27. socialScholarship = minSalary * 0.35;
  28. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  29. } else if (socialScholarship > excellentScholarship) {
  30. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  31. } else {
  32. excellentScholarship =Math.floor(mark * 25);
  33. System.out.printf("You get a scholarship for excellent results %.0f BGN", excellentScholarship);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement