home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
353_02
/
boxes2.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-19
|
689b
|
28 lines
// Chapter 5 - Program 9
#include <iostream.h>
#include "box.h"
main()
{
box small, medium, large; //Three boxes to work with
small.set(5, 7);
// Note that the medium box uses the values
// supplied by the constructor
large.set(15, 20);
cout << "The small box area is " << small.get_area() << "\n";
cout << "The medium box area is " << medium.get_area() << "\n";
cout << "The large box area is " << large.get_area() << "\n";
}
// Result of execution
//
// The small box area is 35
// The medium box area is 64
// The large box area is 300