#include <iostream>
#include <iomanip>

using namespace std;

int getTileWidth(int);
int getTileLength(int, int);
int getTileArea(int, int);
double getSurfaceArea(int, int); 
int getTotalTile(double, int);

int main()
{
	int tileCode, surfaceWidth, surfaceLength, 
		tileWidth, tileLength, tileArea,
		surfaceArea,
		tileCount;
	
	cout << "Enter tileCode: ";
	cin >> tileCode;
	cout << "Enter surface width in Feet: ";
	cin >> surfaceWidth;
	cout << "Enter surface length in Feet: ";
	cin >> surfaceLength;
	cout << endl;
	
	tileWidth = getTileWidth (tileCode);
	cout << "Tile width in inches: " << tileWidth << endl;
	tileLength = getTileLength(tileCode, tileWidth);
	cout << "Tile length in inches: " << tileLength << endl;
	tileArea = getTileArea(tileLength, tileWidth);
	cout << "Tile area in inches square: " << tileArea << endl << endl;
	
	cout << "Surface width in Feet: " << surfaceWidth << endl;
	cout << "Surface length in Feet: " << surfaceLength << endl;
	surfaceArea = getSurfaceArea(surfaceLength, surfaceWidth);
	cout << "Surface area in inches square: " << surfaceArea << endl << endl;
	
	tileCount = getTotalTile(surfaceArea, tileArea);
	cout << "Total tile needed: " << tileCount <<  endl;
	
	return 0;
}

int getTileWidth(int tileCode)
{
	int tileWidthInInches = tileCode / 100;
	
	return tileWidthInInches;
}

int getTileLength(int tileCode, int tileWidth)
{
	int tileLengthInInches = tileCode - (tileWidth * 100);
	
	return tileLengthInInches;
}

int getTileArea(int tileLength, int tileWidth)
{
	int tileArea = tileWidth * tileLength;
	
	return tileArea;
}

double getSurfaceArea(int surfaceLength, int surfaceWidth)
{
	double surfaceArea = (surfaceWidth*12) * (surfaceLength*12);
	
	return surfaceArea;
}

int getTotalTile(double surfaceArea, int tileArea)
{
	int tileCount = surfaceArea / tileArea;
	
	return tileCount;
}
