Code Clipping Wont Convert Correctly.

Alright I know Im new here, so ill try to make this look as professional and good as possible. Im writing a program to do different tasks, all i need help with is the mathimatics part of a Metric Conversion. The Teacher wants us to convert a inputed meter and centimeter (add them up) convert them into a feet in INT and a inch in INT so like 5 FEET and 4 INCHES not 5'4" or w.e. So im going from a DOUBLE centimeter/meter to INT feet/inches. heres the code help would be greatly apprieceated as well as what i did WRONG

void MetricConversion()
{
// local variables
char ch;
double meter, cm, cm1, conversion = 3.2808399, temp, answer;
int feet1, inch1;
//Input
clrscr();
gotoxy(5,8);
cout << "Please Enter Your The Number(In Metres): " <<flush;
cin >> meter;
cout <<"Please Enter The Next Number (In Centimeters): " <<flush;
cin >> cm;

//Process
cm1 = cm / 100;
answer = cm1 + meter;
//feet w/ decimal
feet1 = conversion * answer;
feet1 = temp;
inch1 = temp / 12;
gotoxy(25,15);
cout.setf(ios::fixed);


//output
cout << setprecision(4) << feet1 <<flush;
gotoxy(6,10);
cout << inch1 <<flush;
wait();
}


Thanks The Wait at the end redirects to a PRESS ANY KEY function.

MrWarhawk
please state ur problem rather than ask ppl to find ur problem
Topic archived. No new replies allowed.