Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. //HEADER FILE
  2. #ifndef RECTANGLE_H
  3. #define RECTANGLE_H
  4.  
  5. class Rectangle:public Shape{
  6. protected:
  7. length;
  8. width;
  9. public:
  10. Rectangle(); //constructor
  11. void setvalues(int l, int w);
  12. void printvalues();
  13. };
  14. __________________________________________________
  15. // RECTANGLE CPP FILE
  16.  
  17. #include "Rectangle.h"
  18. #include <iostream>
  19. int a, b;
  20. Rectangle::Rectangle(){
  21. length = 0; width = 0;
  22. }
  23. void Rectangle::setvalues(int l, int w){
  24. length = l; width = w;
  25. }
  26.  
  27. a = area();
  28.  
  29. b = boundaries(int length, int width);
  30.  
  31. cout << "the area of the rectangle is " << a
  32. <<"the perimeter is "<< b;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement