CIS 1033 - Fundamentals of Programming

Bob Comer, Professor, CIS/CSC


Chapter 7 Homework

Click here for answers.

  1. Write a Print() member function for the Change class from Lab Assignment 7. It should print the change as the number of pennies, nickels, dimes, and quarters, something like this:

    The change is:
    1 penny(s)
    3 nickel(s)
    1 dime(s)
    3 quarter(s)
    Write a few lines of client code to test your function (create a Change object, assign it a value, and print it).
  2. Run the Example program Time4.cpp. Describe where in the code each line of output comes from.
  3. Modify the default constructor for the Time class in Example program Time4.cpp to call the Set() member function. After this change, what will be printed by the following statement?

    Time watch;


Return to Fundamentals Home Page

URL: http://www.austin.cc.tx.us/comer/cis1033/
Copyright: Ó 1999 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to: Bob Comer
Last updated: July 5, 1999

Austin Community College is an equal opportunity educator and employer.