Help With Equation

I am stuck on a question for my grade 10 comp sci class. Ive been stuck on it for days and the teacher just "gives me hints." my program runs fine its the formula im stuck on. The program is meant to prompt for an input of inches and output yards feet and inches.How many inches? 49 = 1 yard 1 foot 1 inch. my formula i have for the process is
1
2
3
4
5
 yards = inches / 36;
   inches = inches - yards * 36
   feet = inches / 12;
   inches2 = inches2 % feet;
 

Where everything is a int except for inches

for output i have
1
2
3
4
5
6
7
   gotoxy(35,8);
    cout << yards << " yards" << flush;
    gotoxy(35,9);
    cout << feet << " feet" << flush;
    gotoxy(35,10);
    cout << inches2 << " inches" << flush;
    wait();

please help!!!
closed account (D80DSL3A)
I think that only line 4 in your formula is wrong. Try: inches = inches%12;
Try putting some cout objects in your function call to see what is happening. That way you can break down the whole process and see exactly what is happening
Topic archived. No new replies allowed.