Answer to Question contract-4

No. It does not say that this function changes y. It does not indicates that the value returned is the sum of x and the new value of y. From the contract, you would expect that
  int a = 2;
  int b = 3;
  int c = sum(a,b);
would make c = 5 and leave b = 3. In fact, it makes c = 6 and b = 4.