/****************************************************************************** Lab Exercise #4 -- Implementation of driver function ******************************************************************************/ using namespace std; #include void ConvertLength( double&, char, char ); /*----------------------------------------------------------------------------- Name: main Purpose: Convert measurements from the English to the metric system Input: A measurement in the English system Output: The equivalent measurement in the metric system -----------------------------------------------------------------------------*/ int main() { double Length; char English, Metric; cout << "\nAt the prompts, enter a measurement and its English unit,\n"; cout << "then enter the metric unit for the conversion.\n\n"; while (1) { cout << "Enter a measurement (ctrl-d to halt): "; cin >> Length; if (cin.eof() || cin.fail()) break; cout << "Enter the English unit of measure (I,F,Y,M): "; cin >> English; cout << "Enter the metric unit of measure (C,M,K): "; cin >> Metric; ConvertLength( Length, English, Metric ); cout << "\nThe measurement = " << Length << " " << Metric << "\n\n"; } cout << "\n\n*** program halted normally ***\n\n"; }