Advertisement
VlaDun

zadachaStipendia

Sep 16th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         double dohod = Double.parseDouble(scan.nextLine());
  9.         double uspeh = Double.parseDouble(scan.nextLine());
  10.         double zaplataMin = Double.parseDouble(scan.nextLine());
  11.         //social moneyz
  12.         if(dohod <= zaplataMin && uspeh >= 4.5)
  13.         {
  14.             double socStipendia = Math.floor(zaplataMin*0.35);
  15.             System.out.printf("You get a Social scholarship %.0f BGN", socStipendia);
  16.  
  17.  
  18.         }else if(uspeh >= 5.5)
  19.  
  20.         {
  21.             double uspehCoef = Math.floor(uspeh*25);
  22.             System.out.printf("You get a scholarship for excellent results %.0f BGN", uspehCoef);
  23.  
  24.  
  25.  
  26.         }else if ( uspeh < 5.5)
  27.         {
  28.             System.out.println("You cannot get a scholarship!");
  29.         }
  30.         else if(uspeh*25 < zaplataMin*0.35)
  31.         {
  32.             double socStipendia = Math.floor(zaplataMin*0.35);
  33.             System.out.printf("You get a Social scholarship %.0f BGN", socStipendia
  34.      
  35.         }else
  36.         {
  37.             System.out.println("You cannot get a scholarship!");
  38.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement