#include<iostream>
using namespace std;
// Declare area functions for circle
// and rectangle
float area(float radius);
float area(float length, float width);
// Begin main function
int main()
{
float radius, length,width;
// Compute circle area
cout << "Give a radius: ";
cin >> radius;
cout << "Area is: " << area(radius) << endl;
// Compute rectangle area
cout << "Give a length and width: ";
cin >> length >> width;
cout << "Area is: " << area(length,width) << endl;
return 0;
}
// Pre-condition: one positive float input as radius
// Post-condition: output float area of circle with
// input radius
float area(float radius)
{
return 3.14*radius*radius;
}
// Pre-condition: two positive floats input as length
// and width
// Post-condition: output float area of rectangle with
// input length and width
float area(float length,float width)
{
return length*width;
}