Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.46 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 dohod = Double.parseDouble(scanner.nextLine());
  7.         double usph = Double.parseDouble(scanner.nextLine());
  8.         double zapl = Double.parseDouble(scanner.nextLine());
  9.         double soc = zapl * 0.35;
  10.         double uspeh = usph * 25;
  11.  
  12.             if(dohod < zapl && usph > 4.5 && usph < 5.50){
  13.                    System.out.print("You get a Social scholarship ");
  14.                    System.out.printf("%.0f", Math.floor(soc));
  15.                    System.out.print(" BGN");
  16.             } else if (usph >= 5.5 && uspeh > soc) {
  17.                 System.out.print("You get a scholarship for excellent results ");
  18.                 System.out.printf("%.0f", Math.floor(uspeh));
  19.                 System.out.print(" BGN");
  20.             } else if (dohod > zapl && usph >= 5.5) {
  21.                 System.out.print("You get a scholarship for excellent results ");
  22.                 System.out.printf("%.0f", Math.floor(uspeh));
  23.                 System.out.print(" BGN");
  24.             }else if (dohod < zapl && usph >= 5.5 && uspeh < soc) {
  25.                 System.out.print("You get a Social scholarship ");
  26.                 System.out.printf("%.0f", Math.floor(soc));
  27.                 System.out.print(" BGN");
  28.             } else {
  29.                 System.out.println("You cannot get a scholarship!");
  30.             }
  31.  
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement