week4_example_1_Headerfile

week4_example_1_Headerfile - class definition#include...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // class definition #include <cmath> class rectangle { private: double length double width public: static int howmany //how many rectangles rectangle() //default constructor. rectangle(double, double) //copy constructor ~rectangle() //destructor void setLength(double) void setWidth(double) void setDimensions(double, double) double getLength() double getWidth() double getArea() double getPerimeter() double getH() } // class implementation rectangle::rectangle() { length = 0.0 width = 0.0 howmany++ } rectangle::rectangle(double len, double wid) { length = len width = wid howmany++ //OR setDimensions(len,wid) }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

week4_example_1_Headerfile - class definition#include...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online