Question

Problem 4 (11 pts, 1 pt. for each condition): Forward reasoning Find the strongest postcondition of each code sequence by inserting the appropriate condition in each blank. The first condition in part (a) is supplied as an example Please simplify your answers as much as possible. Assume all variables are ints Copy all code to your answer file and fill in the blanks. Carry all variables forward. Show all work. fx> 0 ) x10 10 y 20 -xi x11 ) x=-x; x=x+1; 5 if (x > 0) )else ( y=x-1;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1

a. y==10

b. z==14

c. y==0

2

a. |x|>11

b. x>121

c. x>122

3

a. x<5

b. y<7

c. x>-5

d. y>-6

e. |x|<5

Add a comment
Know the answer?
Add Answer to:
Problem 4 (11 pts, 1 pt. for each condition): Forward reasoning Find the strongest postcondition of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT