/********************************************************************************\
 *										*
 *	Author:		Jeff Baron						*
 *										*
 *	Date:		09/09/02						*
 *										*
 *	Purpose:	Write a program to compute the area and perimeter if a 	*
 *			rectangle. 						*
 *										*
\********************************************************************************/

#include <iostream>

using namespace std;

struct rectangle
{
	float width;
	float height;
};

float computeArea(float &theWidth, float &theHeight);		//computes the area of a rectangle
float computePerimeter(float &theWidth, float &theHeight);	//computes the perimeter of a rectangle

void main(){

	rectangle theRect(3,5);

	cout << computeArea(theRect.width, theRect.height) << " , " << computePerimeter(theRect.width, theRect.height);

}

/********************************** computeArea *********************************\

	Description:	computes the Area of a rectangle

	Parameters:	width:width of the recangle
			height:hieght of the rectangle

	Returns:	theArea: a floating value for printing or further
			calculations

\********************************************************************************/
float computeArea(&theWidth, &theHeight){
	float theArea;

	theArea = (theWidth * theHeight); //compute area

	return (theArea);
}


/******************************** computePerimeter *******************************\

	Description:	computes the Perimeter of a rectangle

	Parameters:	width:width of the recangle
			height:hieght of the rectangle

	Returns:	thePerimeter: a floating value for printing or further
			calculations

\********************************************************************************/
float computePerimeter(&theWidth, &theHeight){
	float thePerimeter;

	thePerimeter = ((theWidth * 2) + (theHeight * 2)); // compute perimeter, parenthesis to show order of operations

	return(thePerimeter);
}
