Advertisement
finderabc

P07_Scholarship - 1

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