Advertisement
Spocoman

Scholarship

Sep 9th, 2024
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double income = Double.parseDouble(scanner.nextLine()),
  7.                 average = Double.parseDouble(scanner.nextLine()),
  8.                 salary = Double.parseDouble(scanner.nextLine()),
  9.                 social = salary * 0.35,
  10.                 excellent = average * 25;
  11.  
  12.         if (average < 4.50) {
  13.             System.out.println("You cannot get a scholarship!");
  14.         } else if (average > 4.50 && average < 5.50) {
  15.             if (income < salary) {
  16.                 System.out.println("You get a Social scholarship " + (int) social + " BGN");
  17.             } else {
  18.                 System.out.println("You cannot get a scholarship!");
  19.             }
  20.         } else {
  21.             if (income < salary) {
  22.                 if (excellent < social) {
  23.                     System.out.println("You get a Social scholarship " + (int) social + " BGN");
  24.                 } else {
  25.                     System.out.println("You get a scholarship for excellent results " + (int) excellent + " BGN");
  26.                 }
  27.             } else {
  28.                 System.out.println("You get a scholarship for excellent results " + (int) excellent + " BGN");
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement