raliportokali

Untitled

May 3rd, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 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 AvGrade = Double.parseDouble(scanner.nextLine());
  8. double MinSalary = Double.parseDouble(scanner.nextLine());
  9. double SocSch = 0.35 * MinSalary;
  10. double GradeSch = 25 * AvGrade;
  11.  
  12. if (AvGrade >= 5.5 & Income < MinSalary & SocSch >= GradeSch) {
  13. System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(SocSch));
  14. } else if (AvGrade >= 5.5 & Income < MinSalary & SocSch < GradeSch) {
  15. System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(GradeSch));
  16. } else if (AvGrade > 4.5 & Income < MinSalary) {
  17. System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(SocSch));
  18. } else if (AvGrade >= 5.5){
  19. System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(GradeSch));
  20. } else {
  21. System.out.println("You cannot get a scholarship!");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment