Advertisement
Guest User

Untitled

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