Homework # 6  - due Tuesday October 4th

 

  1. Read the section on pre and post conditions and do problems 19 a and b  and 20 a  from Chapter 3 found  on pages 172 & 173 (also shown below)

 

19.     Compute the weakest precondition for each of the following statements and postconditions

 

a.          a = 2 * (b – 1) – 1   {a > 0}

 

 

b.       b = (c + 10) / 3   { b > 6}

 

 

20.     Compute the weakest precondition for each of the following sequences of assignment statements and their postconditions

 

a.          a = 2 * b + 1;

   b = a – 3

   { b < 0}

 

  1.  Answer the Pascal questions found here