Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- void get_numbers(double& input1, double& input2);
- void show_results(double output1, double output2);
- int main()
- {
- char letter;
- cout<<"Metric to English and English to Metric converter.\n"
- <<"For Metric to English type m, for Enlish to Metric type E, Type q to quit.\n";
- cin>>letter;
- double first_num, second_num;
- get_numbers(first_num, second_num);
- show_results(first_num, second_num);
- return 0;
- }
- void get_numbers(double& input1, double& input2)
- {
- using namespace std;
- cout<< "Enter first number as meters and second as centimeters.\n";
- cin>> input1
- >> input2;
- input1 = input1 * 3.2808399;
- input2 = input2 * .393700787;
- }
- void show_results(double output1, double output2)
- {
- using namespace std;
- cout<< "Feet: "<<output1<<" Inches: "<<output2<<endl;
- }