Advertisement
NickShalamov

Untitled

Jan 23rd, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. package com.SoftUni;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Problem08 {
  6. public static void main(String[] args) {
  7. Scanner scan = new Scanner(System.in);
  8. //input
  9. double income = Double.parseDouble(scan.nextLine());
  10. double averageMark = Double.parseDouble(scan.nextLine());
  11. double minIncome = Double.parseDouble(scan.nextLine());
  12. double socialScholarship = Math.floor(minIncome * 0.35);
  13. double excellenceScholarship = Math.floor(averageMark * 25);
  14. //check-ups
  15. if ((income < minIncome) && (averageMark > 4.5) && (averageMark < 5.5)) {
  16. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  17. } else if ((income < minIncome) && (averageMark >= 5.5) && (socialScholarship > excellenceScholarship)) {
  18. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  19. } else if ((income < minIncome) && (averageMark >= 5.5) && (socialScholarship <= excellenceScholarship)) {
  20. System.out.printf("You get a scholarship for excellent results %.0f BGN", excellenceScholarship);
  21. } else if ((income > minIncome) && (averageMark >= 5.5)) {
  22. System.out.printf("You get a scholarship for excellent results %.0f BGN", excellenceScholarship);
  23. }else {
  24. System.out.println("You cannot get a scholarship!");
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement