Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

PRECONDITION: Input is a natural number x. POSTCONDITION: Output is 2^x. def power(x): 1. current = 1 2. count = 0 3. while (count < x): 4. ++++current = current * 2 5. ++++count = count + 1 6. return current Prove correctness of power with respect to the given specification.

OpenStudy (anonymous):

here the + is for the spaces(indented)

OpenStudy (anonymous):

I think you should use 2.0 rather than 2,and you should compare result of power with 2**x

OpenStudy (anonymous):

we have to prove correctness dude, your reply is so LAME

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!