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