Goodiny777

Java Lesson 2 classwork

Dec 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.15 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.lang.Math;
  3.  
  4. public class tester {
  5.  
  6.     public static void main(String[] args){
  7.         Scanner sc = new Scanner(System.in);
  8.        
  9.         //Targil 3
  10.         int test_grade, homework_avr, exercise;
  11.         String res;
  12.         System.out.println("Enter your test grade(0-100), average of homework(0-10), maden exersises(0-8)");
  13.         test_grade = sc.nextInt();
  14.         homework_avr = sc.nextInt();
  15.         exercise = sc.nextInt();
  16.         if (exercise<=4){res = "Fail";}
  17.         else if(homework_avr>4&&homework_avr<7){}
  18.        
  19.        
  20.        
  21.        
  22.        
  23.        
  24.        
  25.        
  26.         //Targil 2
  27.         /*int weight, age, height;
  28.         double yahas;
  29.         boolean tnai_1, tnai_2;
  30.         String res = "No menu for you";
  31.         System.out.println("Please enter your age, weight(kg), height(sm) separeted by space");
  32.         age= sc.nextInt();
  33.         weight=sc.nextInt();
  34.         height=sc.nextInt();
  35.         yahas = height/weight;
  36.         tnai_1=yahas>0.5&&yahas<=2.0;
  37.         tnai_2=yahas>2.0&&yahas<3.5;
  38.         if (tnai_1){res ="A menu";}
  39.         else if(tnai_2){
  40.             if(age>=11&&age<=20){res="B menu";}
  41.             else if(age>20&&age<41){res="C menu";}
  42.         }
  43.         System.out.println(res);*/
  44.        
  45.         //Targil 1
  46.         /*  int a1, a2, a3, a4, a5, a6, a7, a8;
  47.         int b1, b2, b3, b4, b5, b6, b7, b8;
  48.         int c = 30;
  49.         boolean res;
  50.  
  51.         a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 2;
  52.         b1 = b2 = b3 = b4 = b5 = b6 = b7 = b8 = 10;
  53.  
  54.         a1 = b1++;                    // a1=11 b1=11
  55.         a2 = b2++ / 2;                // a2=5 b2=11
  56.         a3 = b3 * c;                  // a3=300 b3=10
  57.         a4 *= b4;                     // a4=20 b4=10
  58.         a5 *= b5--;                   // a5=18 b5=9
  59.         a6 *= b6++;                   // a6=22 b6=11
  60.         a7 = a7 * b7 + c % 4 - 5 / 2; // a7=20 b7=10
  61.         res = b8 > c;                 // res=false b8=10
  62.  
  63.         a1 = a2 = a3 = a4 = a5 = a6 = a7 = 1;
  64.         b1 = b2 = b3 = b4 = b5 = b6 = b7 = 10;
  65.  
  66.         res = (true == (c - 25 > 2 + a1++));      // res=true a1=2
  67.         res = (b2 > 5) || (b2 == 12);             // res=true
  68.         res = (b3 < 5) || (b3 == 12);             // res=false
  69.         res = (b4 > 5) && (b4 == 12);             // res=false
  70.         res = (b5 < 5) && (b5 == 12);             // res=false
  71.         res = (b6 == 8 || b6 == 5 && a6 < 0);     // res=false
  72.         res = ((b7 == 0) || (b7 == 7) && a7 < 0); // res=false*/
  73.  
  74.         }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment