Advertisement
mihaellan

Untitled

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