AsyaDamyanova

#java #pb Scholarship

Oct 28th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Scholarship {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double income = Double.parseDouble(scanner.nextLine());
  7. double assessment = Double.parseDouble(scanner.nextLine());
  8. double salary = Double.parseDouble(scanner.nextLine());
  9.  
  10. double socialScholarship = 0.0;
  11. // Math.floor(salary * 0.35);
  12. double excellentScholarship = 0.0;
  13. //Math.floor(assessment * 25);
  14.  
  15. if (income < salary) {
  16. if (assessment >= 4.5) {
  17. socialScholarship = Math.floor(salary * 0.35);
  18. }
  19. } if (assessment >= 5.5) {
  20. excellentScholarship = Math.floor(assessment * 25);
  21. }
  22. if (excellentScholarship > socialScholarship) {
  23. System.out.printf("You get a scholarship for excellent results %.0f BGN", excellentScholarship);
  24. } else if(socialScholarship > excellentScholarship) {
  25. System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  26. } else {
  27. System.out.println("You cannot get a scholarship!");
  28. }
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment