Im stuck at this point. The way i was trying to do this was running if statement around my void function and then a else if statement around a different void function but it didnt work... right now i deleted part of what i had but left my skeleton of it there...
[CODE=c] #include <iostream>
using namespace std;
void get_numbers(dou ble& input1, double& input2);
void show_results(do uble 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(fir st_num, second_num);
show_results(fi rst_num, second_num);
return 0;
}
void get_numbers(dou ble& 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(do uble output1, double output2)
{
using namespace std;
cout<< "Feet: "<<output1< <" Inches: "<<output2<<end l;
}
[/CODE]
[CODE=c] #include <iostream>
using namespace std;
void get_numbers(dou ble& input1, double& input2);
void show_results(do uble 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(fir st_num, second_num);
show_results(fi rst_num, second_num);
return 0;
}
void get_numbers(dou ble& 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(do uble output1, double output2)
{
using namespace std;
cout<< "Feet: "<<output1< <" Inches: "<<output2<<end l;
}
[/CODE]
Comment