Ask Question

Consider the method total below.

public static int total (int result, int a, int b)

{

if (a = = 0)

{

if (b = = 0)

{

return result * 2;

}

return result / 2;

}

else

{

return result * 3;

}

}

The assignment statement

x = total (5, 0, 0);

must result in

x being assigned the value 4

x being assigned the value 8

x being assigned the value 5

x being assigned the value 2

x being assigned the value 10

+1
Answers (1)
  1. 12 May, 08:56
    0
    That code, if it even compiles, won't produce those values with that call.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider the method total below. public static int total (int result, int a, int b) { if (a = = 0) { if (b = = 0) { return result * 2; } ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers