Question: Consider the following methods. / * * Precondition: a > 0 and b > 0 * / publ ic stat ic int methodOne ( int
Consider the following methods.
Precondition: a and b
publ ic stat ic int methodOne int a int b
int loopCount ;
for int i ; i a b; i
loopCount;
return loopCount ;
Precondition: a and b
publ ic stat ic int methodTwo int a int b
int loopCount ;
int i ;
whi le i a
loopCount;
i b;
return loopCount ;
Which of the following best describes the conditions under which methodOne and methodTwo return
the same value?
A When a and b are both even
B When a and b are both odd
C When a is even and b is odd
D When a b is equal to zero
E When a b is equal to one
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
