hpilo

Chapter3_Logic_Ex5

Dec 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. import java.util.Scanner;
  2. /*  ==================================================
  3.       Chapter 3: Logical and conditional expressions
  4.  
  5.         Ex5: Lillipot Collage  
  6.     ===================================================
  7. */
  8.  
  9. public class MyProgram {
  10.     public static void main(String[] args) {
  11.        
  12.         //variables
  13.         int psychometric;
  14.         float bagrot;
  15.         int math;
  16.         int english;
  17.         double average;
  18.         Scanner s=new Scanner(System.in);
  19.  
  20.         //1.2/(ציון בגרות) + 0.8 * (ציון פסיכומטרי)
  21.  
  22.         System.out.println("Enter your bagrot average: ");
  23.         bagrot=s.nextFloat();
  24.  
  25.         System.out.println("psychometric: Enter your math score: ");
  26.         math=s.nextInt();
  27.         System.out.println("psychometric: Enter you english score: ");
  28.         english=s.nextInt();
  29.  
  30.         if(bagrot<102){
  31.  
  32.             System.out.println("Enter your psychometric score: ");
  33.             psychometric=s.nextInt();
  34.  
  35.             average = (psychometric * 0.8) + (bagrot / 1.2);
  36.             if (average < 600)
  37.                 System.out.println("Not accepted");
  38.             else
  39.                 System.out.println("accepted with average");
  40.  
  41.  
  42.             if(psychometric>=700 && math>=145 && english>=120)
  43.                 System.out.println("accepted with psychometric");
  44.             else {
  45.                 average = (psychometric * 0.8) + (bagrot / 1.2);
  46.                 if (average < 600)
  47.                     System.out.println("Not accepted");
  48.                 else
  49.                     System.out.println("accepted with average");
  50.             }
  51.  
  52.         }
  53.         else
  54.             System.out.println("accepted with bagrot");
  55.  
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment