CSC 101 Updates and Corrections from Weeks 5 and 6

CSC 101
Updates and Corrections to Handouts
from Weeks 5 and 6

  1. When implementing Programming Assignment 4, any function that uses an input parameter of type ifstream should declare the input as a reference parameter, even if the parameter is not explicitly changed in the body of the function. The reason has to do with the central UNIX implementation of ifstream.
  2. In the REVISED writeup for Programming Assignment 4:
    1. Page 5, second to last line from bottom of page, change
      9PM May 9
      to
      9PM May 10
    2. Page 6, Figure 1, the function in the diagram that appears as

      would be more accurately labeled as

      That is, the function does not output all of the heading, but rather some of it.
  3. In Lecture Notes Week 6:
    1. Page 2, each cout line should be changed from
      cout << ...
      
      to
      cout << "    " << ...
      
      E.g., the first cout changes from
      cout << dollars << " dollar" << endl;
      
      cout << "    " << dollars << " dollar" << endl;
      
      These changes make the "After" version of the program correctly output four spaces of indentation in front of each output line, per the specs.
    2. Page 5, Item D.1, "Function declaration", the declaration is wrong. Instead of the declaration for function ComputeChange, the declaration should be for function ComputeDenomination. The correct declaration is:

      ////
      //
      // Function ComputeDenomination computes the amount of change due in a
      // particular denomination and updates the change due by subtracting the
      // computed amount.  The inputs are an empty integer amount variable, an
      // integer total amount variable, and the integer value of the denomination.
      // The outputs are the computed amount in the first parameter and the updated
      // change in the second parameter.
      //
      ////
      void ComputeDenomination(
          int& amount,                        // Amount of denomination
          int& change,                        // Total change due
          int denomination_value              // Value in cents of the denomination
      );