/* Algorithm prompt for distance in inches read in distance in inches. convert to feet and inches conver to yards and feet print the fisrt result convert yards, feet, inches to inches yards * INCHES_PER_YARD + feet * INCHES_PER_FOOT + inches print the Check result */ /* scratch area 51 / 36 = 1 R 15 15 / 12 = 1 R 3 * */ #include using namespace std; const int INCHES_PER_FOOT {12}; const int FEET_PER_YARD {3}; int main() { int inputInches {0}, finalInches {0}; int yards {0}, feet {0}, inches {0}; // prompt and read input cout << "Please enter a measurement in inches: "; cin >> inputInches; cout << endl; cout << inputInches << " is the same as:" << endl; // do the conversion cout << inputInches << " inches." << endl; feet = inputInches / INCHES_PER_FOOT; // input 50 inches inches = inputInches % INCHES_PER_FOOT; // 4 feet 2 inches cout << feet << " feet " << inches << " inches" << endl; yards = feet / FEET_PER_YARD; feet = feet % FEET_PER_YARD; cout << yards << " yards " << feet << "feet " << inches << " inches" << endl; cout << "\tYards:\t" << yards << endl; cout << "\tFeet:\t" << feet << endl; cout << "\tInches:\t" << inches << endl; return 0; }