Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "rectangle.h"
- using namespace std;
- int main()
- {
- Rectangle a, b(4.0, 5.0), c(67.0, 888.0);
- cout << fixed;
- cout << setprecision(1);
- // output Rectangle a
- cout << "a: length = " << a.getLength() << "; width = "
- << a.getWidth() << "; perimeter = " << a.calculatePerimeter()
- << "; area = " << a.calculateArea() << '\n';
- // output Rectangle b
- cout << "b: length = " << b.getLength() << "; width = "
- << b.getWidth() << "; perimeter = " << b.calculatePerimeter()
- << "; area = " << b.calculateArea() << '\n';
- // output Rectangle c; bad values attempted
- cout << "c: length = " << c.getLength() << "; width = "
- << c.getWidth() << "; perimeter = " << c.calculatePerimeter()
- << "; area = " << c.calculateArea() << endl;
- } // end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement