This question has 3 parts. Answer all correctly and I will upvote!

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

This question has 3 parts. Answer all correctly and I will upvote!

Post by answerhappygod »

This question has 3 parts. Answer all correctly and I will
upvote!
This Question Has 3 Parts Answer All Correctly And I Will Upvote 1
This Question Has 3 Parts Answer All Correctly And I Will Upvote 1 (36.93 KiB) Viewed 22 times
Question #3 (20 points) Consider the following code fragment: 1 3 Do-Math(x, y) result = x 2 = 0 while z <y z = % + 1 result = result / 2 return result + 7 Provide clear, concise answers to each of the following related questions. (3 points). What does Do Math(32,4) return? (12 points). Argue the correctness of the following loop invariant for Do-Math(): result = 2/2- Be sure to argue both the initial condition and the maintenance condition. (5 points). Using the invariant, prove the correctness of Do-Math(). Don't forget to use the loop test condition.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply