Advertisement
panPC

Scholarship - PB Java

Jul 25th, 2020 (edited)
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 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. //Доход в лева - реално число в интервала [0.00..6000.00]
  7. //2. Среден успех - реално число в интервала [2.00...6.00]
  8. //3. Минимална работна заплата - реално число в интервала
  9.         double incomeLeva = Double.parseDouble(scanner.nextLine());
  10.         double averageGrade = Double.parseDouble(scanner.nextLine());
  11.         double minimalIncome = Double.parseDouble(scanner.nextLine());
  12.  
  13.         if (incomeLeva < minimalIncome && averageGrade > 4.5) {
  14.             double input1 = minimalIncome * 0.35;
  15.             System.out.printf("You get a Social scholarship %.0f BGN", input1);
  16.  
  17.         } else if (averageGrade > 5.5) {
  18.             double  input2 = Math.round(averageGrade * 25);
  19.             System.out.printf("You get a scholarship for excellent results %.2f BGN", input2);
  20.         } else {
  21.             System.out.println("You cannot get a scholarship!");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement