Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.lang.Math;
- public class tester {
- public static void main(String[] args){
- Scanner sc = new Scanner(System.in);
- //Targil 3
- int test_grade, homework_avr, exercise;
- String res;
- System.out.println("Enter your test grade(0-100), average of homework(0-10), maden exersises(0-8)");
- test_grade = sc.nextInt();
- homework_avr = sc.nextInt();
- exercise = sc.nextInt();
- if (exercise<=4){res = "Fail";}
- else if(homework_avr>4&&homework_avr<7){}
- //Targil 2
- /*int weight, age, height;
- double yahas;
- boolean tnai_1, tnai_2;
- String res = "No menu for you";
- System.out.println("Please enter your age, weight(kg), height(sm) separeted by space");
- age= sc.nextInt();
- weight=sc.nextInt();
- height=sc.nextInt();
- yahas = height/weight;
- tnai_1=yahas>0.5&&yahas<=2.0;
- tnai_2=yahas>2.0&&yahas<3.5;
- if (tnai_1){res ="A menu";}
- else if(tnai_2){
- if(age>=11&&age<=20){res="B menu";}
- else if(age>20&&age<41){res="C menu";}
- }
- System.out.println(res);*/
- //Targil 1
- /* int a1, a2, a3, a4, a5, a6, a7, a8;
- int b1, b2, b3, b4, b5, b6, b7, b8;
- int c = 30;
- boolean res;
- a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 2;
- b1 = b2 = b3 = b4 = b5 = b6 = b7 = b8 = 10;
- a1 = b1++; // a1=11 b1=11
- a2 = b2++ / 2; // a2=5 b2=11
- a3 = b3 * c; // a3=300 b3=10
- a4 *= b4; // a4=20 b4=10
- a5 *= b5--; // a5=18 b5=9
- a6 *= b6++; // a6=22 b6=11
- a7 = a7 * b7 + c % 4 - 5 / 2; // a7=20 b7=10
- res = b8 > c; // res=false b8=10
- a1 = a2 = a3 = a4 = a5 = a6 = a7 = 1;
- b1 = b2 = b3 = b4 = b5 = b6 = b7 = 10;
- res = (true == (c - 25 > 2 + a1++)); // res=true a1=2
- res = (b2 > 5) || (b2 == 12); // res=true
- res = (b3 < 5) || (b3 == 12); // res=false
- res = (b4 > 5) && (b4 == 12); // res=false
- res = (b5 < 5) && (b5 == 12); // res=false
- res = (b6 == 8 || b6 == 5 && a6 < 0); // res=false
- res = ((b7 == 0) || (b7 == 7) && a7 < 0); // res=false*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment