Advertisement
veronikaaa86

Scholarship

Oct 1st, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P02_Scholarship {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double income = Double.parseDouble(scanner.nextLine());
  8.         double avGrade = Double.parseDouble(scanner.nextLine());
  9.         double minSalary = Double.parseDouble(scanner.nextLine());
  10.  
  11.         double socScholarship = 0.0;
  12.         double gradeScholarship = 0.0;
  13.  
  14.         if (income<=minSalary && avGrade>4.50 && avGrade<5.50) {
  15.             socScholarship = minSalary * 0.35;
  16.         } else if (avGrade>=5.50) {
  17.             gradeScholarship = avGrade*25;
  18.         }
  19.  
  20.         if (socScholarship>gradeScholarship) {
  21.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socScholarship));
  22.         } else if (socScholarship<gradeScholarship){
  23.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(gradeScholarship));
  24.         } else {
  25.             System.out.println("You cannot get a scholarship!");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement