#include #include #include using namespace std; const int INCHES_PER_FOOT {12}; const int FEET_PER_YARD {3}; int main() { int startLength; int finishInches, finishFeet, finishYards; int tempMeasure; cout << "Please enter a measurement in inches: "; cin >> startLength; // compute the finish inches finishInches = startLength % INCHES_PER_FOOT; tempMeasure = startLength / INCHES_PER_FOOT; // compute feet and yards. finishFeet = tempMeasure % FEET_PER_YARD; finishYards = tempMeasure / FEET_PER_YARD; cout << startLength << " inches is the same as: " << endl; cout << "\tYards: " << setw(6) << finishYards << endl; cout << "\tFeet: " << setw(7) << finishFeet << endl; cout << "\tInches: " << setw(5) << finishInches << endl; cout << endl; tempMeasure = finishInches + finishFeet * INCHES_PER_FOOT + finishYards * FEET_PER_YARD * INCHES_PER_FOOT; cout << finishYards << " Yards " << finishFeet << " Feet and " << finishInches << " Inches is " << tempMeasure << " Inches." << endl; return 0; }