Advertisement
Kancho

Final Scholarship

Jan 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Scolarship {
  4. public static void main(String[] args) {
  5.  
  6. Scanner keyboard = new Scanner(System.in);
  7. System.out.print("Enter min. salary: ");
  8. int minSalary = keyboard.nextInt();
  9. System.out.print("Enter family's income: ");
  10. int familyIncome = keyboard.nextInt();
  11. System.out.print("Enter family members: ");
  12. int familyMembers = keyboard.nextInt();
  13. double incomePerMember = familyIncome / familyMembers;
  14. System.out.print("Enter pupil's average success: ");
  15. double success = keyboard.nextDouble();
  16. double socialScholarship = minSalary * 0.35;
  17. double successScholarship = success * 35;
  18. if (success < 4.50) {
  19. System.out.println("You do not receive any scholarship.");
  20. } else if ((4.50 <= success) && (success < 5.50 ) && (incomePerMember > minSalary)){
  21. System.out.println("You do not receive social scholarship.");
  22. } else if ((4.50 <= success) && (success < 5.50 ) && (incomePerMember < minSalary)) {
  23. System.out.printf("You receive social scholarship of %.2f BGN.", socialScholarship);
  24. } else if ( (5.50 <= success) && (socialScholarship >= successScholarship) ) {
  25. System.out.printf("You receive social scholarship of %.2f BGN", socialScholarship);
  26. } else if ( (5.50 <= success) && (socialScholarship < successScholarship) ) {
  27. System.out.printf("You receive scholarship for excellent success of %.2f BGN.", successScholarship);
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement