Question: i) Consider the following algorithm. 1. Input as a non-fractional number in base 8. 2. 0. 3. for = 1 to the number of digits
i) Consider the following algorithm. 1. Input as a non-fractional number in base 8. 2. 0. 3. for = 1 to the number of digits in . 3.1. + 81 'th digit of from the right 4. end for 5. output
a) Trace the algorithm starting with the input = 1502.
b) What changes would need to be made to the algorithm to convert a non-fractional hexadecimal to decimal? Document these changes using pseudo-code. Make sure you clearly reference any lines of code you have to change in the algorithm above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
