Activity 11
Activity 11
#include <iomanip>
#include <cmath>
using namespace std;
class shape
{
private:
float length;
float width;
float base;
float height;
float side;
public:
shape ()
{
length = 0;
width = 0;
base = 0;
height = 0;
side = 0;
}
setMeasurement (float l, float w, float b, float h, float s)
{
length = l;
width = w;
base = b;
height = h;
side = s;
}
};
triangle t;
square square;
rectangle r;
parallelogram p;
float b, h , l, w, s;
t.setTriangle(b, h);
r.setRectangle(l, w);
square.setSquare(s);
p.setParallelogram(b, h);
t.computeTriangle();
r.computeRectangle();
square.computeSquare();
p.computeParallelogram();