Question: public void test ( int x ) { int y; if ( x % 3 = = 0 ) { y = - 1 ;

public void test(int x){
int y;
if (x %3==0){
y =-1;
}
else if (x <10){
y =-2;
}
else {
y =-3;
}
System.out.println(y);
}
Which of the following test values would test each possible output for the method?
A.1,2,3
B.1,2,12
C.1,3,12
D.1,2,11
E.1,3,11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!