I've been staring at this for about an hour and I honestly have no idea what I'm missing.
#include <iostream>
using namespace std;
void callChain();
double chain(int, int &, int &);
int main()
{
callChain();
}
void callChain() {
int totalInches = 53;
int feet;
int inches;
cout << "\nTesting chain for 53 inches: \nExpected result: 15.46 feet: 4 inches: 5" << endl;
cout << "Actual result: " << chain(totalInches, feet, inches) << " feet: " << feet << " inches: " << inches << endl;
}
double chain(int totalInches, int &feet, int &inches) {
feet = totalInches / 12;
inches = totalInches % 12;
return (feet) * 3.49 + (inches) * .30;
}
The return is correct, so obviously the function is working, but for the life of me I can't figure out why feet and inches aren't changing. Everything is spelled right, I have all my ampersands, but for some reason, the display is showing feet as 8 and inches as 7. I have no idea where those numbers are even coming from.