Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- //always start with a capital letter!
- //class is a "cookie cutter"
- //default access of a class is private
- class Rectangle {
- private:
- //attributes are variables
- double length, width;
- //add a counter
- static int count;
- public:
- //default constructor
- Rectangle();
- //parameterized constructor
- Rectangle(double, double);
- //a "square" constructor
- Rectangle(double);
- ~Rectangle(); //destructor
- bool setLength(double);
- //inline function
- double getLength() { return length; } //no semicolon
- void setWidth(double);
- double getWidth() { return width; }
- double getArea() const;
- double getPerim();
- int getCount();
- };//semicolon
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement