Answer:
Returned value: 2
Explanation:
Public int f(int k, int n) {
if (n == k)
return k;
else if (n > k)
return f(k, n - k);
else return f(k - n, n);
}
/////////////////////////////////////////////////////////////////////////////////////////
Trace of function calls,
f(6, 8)
f(k, n - k) -> (6, 2)
f(k - n, n) -> (4, 2)
f(k - n, n) -> (2, 2)
return k
Answer:
101.1
Explanation:
Keep in mind that octal has 8 numbers
Step 1: Split your number in 2 parts (integer part and decimal part):
- integer part 65
- decimal part 0.125
Step 2: Convert the decimal part. For this step you need to multiply your decimal part and 8 (8 correspond the octal base) and get the integer part until you need it:
0.125 * 8 = 1
So your decimal part correspond to number 1 in octal = (1)8
Step 3: Convert integer part: for this step you need to divide your integer part by 8 until you can and get the remainder
65 / 8 = 8 remainder 1
8 / 8 = 1 remainder 0
1 / 8 = 0 remainder 1
Step 4: join the remainders from bottom to top and get the integer part
101
Step 5: join the integer part and the decimal part to get the octal convertion
101.1
Answer:
improving the current process before automating it
You may do all of the given options.
Thank You!