The object here is to allow a user to enter a measurement, then tell us whether it is feet or inches. The program should convert feet to inches or vice versa and keep doing it until the user enters a sentinel value of 0 to end the program.
What I have now compiles but once I enter a 1 or 2 (for feet or inches) the program stops and wont continue. Can anyone help out?
Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[//Enter a measurement in either feet or inches.
cout << "Enter a measurement in either feet or inches: "; cin >> measurement;
cout << endl;
//Enter a 1 for feet or a 2 for inches.
cout << "Enter a 1 if you used feet or 2 if you used inches : "; cin >> one >> two;
cout << endl;
//Calculate feet to inches and inches to feet and loop when 0 is not entered
measurementfeet = measurement * 12;
measurementinches = measurement / 12;
{ if (one || two < 0);
cout << "Feet or inches cannot be negative";
if (one == true);
return measurement = one; // assigning measurement to 1 if 1 is entered
if (two == true);
return measurement = two; // assigning measurement to 2 if 2 is entered
]