Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package c_ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Scholarship {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. double Income = Double.parseDouble(scanner.nextLine());
  9. double AvGrade = Double.parseDouble(scanner.nextLine());
  10. double MinSalary = Double.parseDouble(scanner.nextLine());
  11. double SocSch = 0.35 * MinSalary;
  12. double GradeSch = 25 * AvGrade;
  13. if (AvGrade >= 4.5 & Income < MinSalary) {
  14. System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(SocSch));
  15. } else if (AvGrade >= 5.5){
  16. System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(GradeSch));
  17. } else {
  18. System.out.println("You cannot get a scholarship!");
  19. }
  20.  
  21. }
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement