Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answers please Consider the following method. public static void ifElse Mystery1(int x, int y) { if (y / x != 0) { y = x
answers please
Consider the following method. public static void ifElse Mystery1(int x, int y) { if (y / x != 0) { y = x + 4; } else { X += 10; } if (x >= y) { y++; System.out.println(x +""+y); For each call below, indicate what output is produced. ifElseMystery1(7, 2) O 178 QUESTION 2 Consider the following method. public static void ifElse Mystery1(int x, int y) { if (y / x != 0) { y = x + 1; } else { X += 10; } if (x >= y) { y++; System.out.println(x +""+y); } W For each call below, indicate what output is produced. ifElseMystery1(10, 20) QUESTION 3 Which statement is to test the number x is between 1 and 10 (includesive)? O if ( 1 =1; x =0) if (x > 0) QUESTION 5 To generate a random number from -40 to 110, we can use the code int number = (int) (Math.random() *x+y); What are the values for x and y? O X=-40, y = 110 O x= 110, y = -40 O x = 151, y = -40 O x =150 y = -40 QU Consider the following method. public static void ifElseMystery1(int x, int y) { int z = 2; if (Z = 0) O if (x % 10 == x) O if (x/10 >= 0) if (x % 2 > 0) QUESTION 9 Which statement is to test the number x is greater than 3 or less than 0? O if (x > 3 && X x>3) O if (x > 3 || X 3) QUESTION 10 To generate a random number from -20 to 120, we can use the code int number = (int) (Math.random() *x+y); What are the values for x and y? O x = -20, y = 120 O x= 120, y = -20 O x = 141, y = -20 Ox=121 y = -20Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started