COSC 1320 - C++ Programming
Bob Comer, Professor, CIT/COSC


Assignment 5 - Rectangle Class

Read through Chapter 6 in your textbook before starting this assignment.

Write a class called Rectangle that represents a rectangle as a pair of floating-point values - the rectangle length and width. The data members of the class should be private members. Your class should include the following public functions:

Write a small client program to test your class. Be sure that your client code calls each of the class functions and prints enough information to show that the class functions work correctly.

Note: Do not use global variables in your program (global constants are okay). Your Rectangle class should only have 2 data members - the length and width.

Note: You can code your class specification, the class implementation, and your client program in the same file.


Return to C++ Home Page

Copyright: Ó2001 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to:
Bob Comer
Last updated: July 5, 2001