You are using a version without Ads of this website. Please, consider donating:

I feel like I almost have this one, Please help me fix whatever is wrong with this!!

My output:
Do you want to convert another set of values?(Y/N): y
Enter feet: 4
Enter inches: 5
Result of conversion: 1 meter(s) and 34.62 centimeters
Press any key to continue . . .

Output should look like this:
Enter feet: 4
Enter inches: 5
Result of conversion: 1 meter(s) and 35 centimeters.
Do you want to convert another set of values (Y/N)? Y
Enter feet: 6
Enter inches: 7
Result of conversion: 2 meter(s) and 1 centimeters.
Do you want to convert another set of values (Y/N)? N
Good Bye!

here are my codes:

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697`` ``````# include using namespace std; void input(double &feet, double &inches); void conversion (double feet, double &inches, int &meters, double ¢imeters);//prototype void output(int meters, double centimeters); //prototype void main () //Input Function { int meters; double feet, inches, centimeters; char menu; do { cout << " Do you want to convert another set of values?(Y/N): "; cin >> menu; input(feet, inches); conversion(feet, inches, meters, centimeters); output (meters, centimeters); if (menu == 'N' || menu == 'n'); { cout << "End of Program " << endl; break; } }while (menu == 'Y' || menu == 'y'); } void input(double &feet, double &inches) { cout << "Enter feet: "; cin >> feet; cout << "Enter inches: "; cin >> inches; } void conversion (double feet, double &inches, int &meters, double ¢imeters) { inches += 12 * feet; centimeters = inches * 2.54; meters = centimeters/100; centimeters -= meters*100; } void output (int meters, double centimeters) { cout << "Result of conversion: " << meters << " meter(s) and " << centimeters << " centimeters " << endl; system ("Pause"); } ``````
Last edited on