Advertisement
Guest User

Untitled

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