Question: E Consider the following code: public void test (int x) { int y; if (x % 2 == 0) y = 3; else if

E Consider the following code: public void test (int x) { int y; if (x % 2 == 0) y = 3; else if (x>9) y = 5; else y = 1; System.out.println("y"+y); } Which of the following test data sets would test each possible output for the method? a.) 7,8,9 d.) 8,9,11 b.) 7, 9, 10 e.) 8, 11, 13 c.) 7, 9, 11
Step by Step Solution
3.54 Rating (157 Votes )
There are 3 Steps involved in it
Answer There is mainly 3 conditions for generating the output 1if x 2 0 y3 2else if x 9 y5 3 else y1 ... View full answer
Get step-by-step solutions from verified subject matter experts
