/* Program 3.3.2 from C++ Programming Lecture notes  */

/* Author: Rob Miller and William Knottenbelt
   Program last changed: 30th September 2001 */

/* This program calculates the area of a given rectangle. */ 

#include<iostream>
using namespace std;

int area(int length, int width);

void get_dimensions(int& length, int& width);

/* MAIN PROGRAM: */
int main()
{
	int this_length, this_width;
	
	get_dimensions(this_length, this_width);							
	cout << "The area of a " << this_length << "x" << this_width;
	cout << " rectangle is " << area(this_length, this_width);
	
	return 0;
}
/* END OF MAIN PROGRAM */

/* FUNCTION TO INPUT RECTANGLE DIMENSIONS: */
void get_dimensions(int& length, int& width)
{
	cout << "Enter the length: ";
	cin >> length;
	cout << "Enter the width: ";
	cin >> width;
	cout << "\n";
}
/* END OF FUNCTION */

/* FUNCTION TO CALCULATE AREA: */
int area(int length, int width)
{
	return length * width;
}
/* END OF FUNCTION */
