Advertisement
kristiyanasimeonova

Untitled

Sep 18th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 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 averageSuccess = Double.parseDouble(scanner.nextLine());
  8.         double minimalSalary = Double.parseDouble(scanner.nextLine());
  9.         double socialScholarship = Math.floor(minimalSalary * 0.35);
  10.         double successScholarship = Math.floor(averageSuccess * 25);
  11.         if (income < minimalSalary && averageSuccess > 5.50){
  12.             if (successScholarship > socialScholarship){
  13.                 System.out.printf("You get a scholarship for excellent results %.0f BGN",successScholarship);
  14.             } else {
  15.                 System.out.printf("You get a Social scholarship %.0f BGN",socialScholarship);
  16.             }}
  17.         else if (income < minimalSalary && averageSuccess > 4.50) {
  18.             System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship); }
  19.         else if (averageSuccess >= 5.50){
  20.             System.out.printf("You get a scholarship for excellent results %.0f BGN",successScholarship);}
  21.         else {
  22.             System.out.print("You cannot get a scholarship!");
  23.  
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement