#include<iostream>
struct shape
{
virtual double perimeter() const = 0;
virtual double area() const = 0;
};
struct circle : shape
{
circle (double radius): r(radius), pi(4*atan(1)) {}
double perimeter() const { return 2*pi*r; }
double area() const { return pi*r*r; }
private:
double r;
const double pi;
};
struct rectangle : shape
{
rectangle (double width, double height): w(width), h(height) {}
double perimeter() const { return 2*(w+h); }
double area() const { return w*h; }
private:
double w;
double h;
};
int main()
{
using std::cout;
using std::endl;
circle c (3.0);
cout << "Circle with radius 3.0\n";
cout << "\tPerimiter: " << c.perimiter() << '\n';
cout << "\tArea: " << c.area() << '\n';
cout << endl;
rectangle r (4.0, 5.0);
cout << "Rectangle with width 4.0 and height 5.0\n";
cout << "\tPerimiter: " << r.perimiter() << '\n';
cout << "\tArea: " << r.area() << '\n';
cout << endl;
}
Area of circle = pi*212 = 1385.44236 square cm Area of rectangle = 1385.44236 square cm Lenght of rectangle = 1385.44236/18 = 76.96902 cm Perimeter of rectangle = 2(76.96902)+2(18) = 189.93804 cm
In the case of a rectangle, you would maximize the area given the perimeter by making the dimensions equal. In other words, you would make the rectangle into a square. However, to truly maximize the area, you would make the perimeter a perfect circle.
the area of a rectangleis 100 square inches. The perimeter of the rectangle is 40 inches. A second rectangle has the same area but a different perimeter. Is the secind rectangle a square? Explain why or why not.
That two different shapes may well have the same perimeter, but different areas. As an example, a 3 x 1 rectangle and a 2 x 2 rectangle have the same perimeter, but the area is different.
No. For example, a 4x1 rectangle will have an area of 4 and a perimeter of 10. A 2x2 rectangle will have the same area of 4, but a perimeter of 8.
Area of circle = pi*212 = 1385.44236 square cm Area of rectangle = 1385.44236 square cm Lenght of rectangle = 1385.44236/18 = 76.96902 cm Perimeter of rectangle = 2(76.96902)+2(18) = 189.93804 cm
Not at all. For example:A square of 2 x 2 will have a perimeter of 8, and an area of 4. A rectangle of 3 x 1 will also have a perimeter of 8, and an area of 3.A "rectangle" of 4 x 0 will also have a perimeter of 8, but the area has shrunk down to zero. The circle has the largest area for a given perimeter/circumference.
In the case of a rectangle, you would maximize the area given the perimeter by making the dimensions equal. In other words, you would make the rectangle into a square. However, to truly maximize the area, you would make the perimeter a perfect circle.
Circle, square, triangle and rectangle of same perimeter. Which will have more area?? The circle will have the greatest area. For regular polygons, the greater the number of vertices, the greater the area. (And so, in the limit, the circle, with an infinite number of vetices, has the greatest area.)
For a given area a circle has least perimeter. eg Let area = 100 sq cms. For the square or rectangle the perimeter = 40 cms For the circle the radius is square root of 100/3.1416 = 5.64 and the circumference = 2 x radius x 3.1416 = 35.44 cms
the area of a rectangleis 100 square inches. The perimeter of the rectangle is 40 inches. A second rectangle has the same area but a different perimeter. Is the secind rectangle a square? Explain why or why not.
The perimeter and area don't depend on each other. Knowing one doesn't tell you the other. -- A circle with perimeter (circumference) of 20 cm has area of 31.83 cm2. -- A square with perimeter of 20 cm has area of 25 cm2 . -- A (9 x 1) rectangle has perimeter of 20 cm and area of 9 cm2 . -- A (8 x 2) rectangle has perimeter of 20 cm and area of 16 cm2 . -- A (7 x 3) rectangle has perimeter of 20 cm and area of 21 cm2 . -- A (6 x 4) rectangle has perimeter of 20 cm and area of 24 cm2 .
That two different shapes may well have the same perimeter, but different areas. As an example, a 3 x 1 rectangle and a 2 x 2 rectangle have the same perimeter, but the area is different.
No. For example, a 4x1 rectangle will have an area of 4 and a perimeter of 10. A 2x2 rectangle will have the same area of 4, but a perimeter of 8.
The perimeter of the rectangle is the sum of its 4 sides.
The length of a rectangle is twice its width. If the perimeter of the rectangle is , find its area.
find the perimeter and area of a rectangle that is 15cm long and 5cm wide