silviasj

scholarship4

Mar 11th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 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.  
  14.         if (AvGrade >= 5.5 & Income < MinSalary & SocSch >= GradeSch) {
  15.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(SocSch));
  16.         }  else if (AvGrade >= 5.5 & Income < MinSalary & SocSch < GradeSch) {
  17.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(GradeSch));
  18.         }  else if (AvGrade > 4.5 & Income < MinSalary) {
  19.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(SocSch));
  20.         }  else if (AvGrade >= 5.5){
  21.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(GradeSch));
  22.         } else {
  23.             System.out.println("You cannot get a scholarship!");
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment