SHARE
TWEET

Untitled

a guest Sep 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  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.  
  9.         double income = Double.parseDouble(scanner.nextLine());
  10.         double achievement = Double.parseDouble(scanner.nextLine());
  11.         double mrz = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double socialScholarship = 0.0;
  14.         double achievementsScholarship = 0.0;
  15.  
  16.         if (achievement >= 5.5) {
  17.             achievementsScholarship = achievement * 25;
  18.         }
  19.         if (achievement > 4.5) {
  20.             if (income < mrz) {
  21.                 socialScholarship = mrz * 0.35;
  22.             }
  23.         }
  24.         if (socialScholarship + achievementsScholarship == 0.0) {
  25.             System.out.println("You cannot get a scholarship!");
  26.         } else if (socialScholarship > achievementsScholarship) {
  27.             System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
  28.         } else {
  29.             System.out.printf("You get a scholarship for excellent results %.0f BGN", achievementsScholarship);
  30.         }
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top