Eric S.

asked • 09/10/17

Consider the following pseudocode function.

Consider the following pseudocode function.function Crunch(x R)
    
if x ≥ 100
then
 
    
return x/100
    
else
 
    
return x + Crunch(10 · x)
(a) Compute Crunch(6).
Crunch(6) = 1

(b) What happens if you try to compute Crunch(−25)? What does this suggest about an appropriate precondition for this function?

1 Expert Answer

By:

Al P. answered • 12/31/17

Tutor
0 (0)

Online Mathematics tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.