CS 3360 Design and Implementation of Programming Languages
Summer 2017, Quiz 1

Name: __________________________________________________________

Use pre- and post-conditions to prove that the following program correctly computes the value amount = 100 - food * D:

  double amount = 100.0;
  for(int day = 1; day <= D; day++)
    {amount -= food;}