Well, the problem is that i have to enter the number of centimeters and output the value in inches, then get how many yards, feet and inches in the inches gotten from the centimeters;
here is my attempt to find the inches from the centimeters.
//----------------------------------------------
//
// Program to find how many yards, feets, inches in X centimeters;
#include <iostream>
#include <iomanip>
using namespace std;
double CENTIMETERS_PER_FOOT = 30.48;
double INCHES = 12.0;
double FEET_PER_YARD = 3.0;
double FOOT = 1.0;
int main()
{
int centimeters;
int yards;
int feet;
int inches;
cout << "Enter length in centimeters: ";
cin >> centimeters;
int totalInches = centimeters / INCHES;
centimeters = (centimeters % static_cast<int>(INCHES));
cout << totalInches << endl;
system("PAUSE");
return 0;
}
now the book says that 312 centimeters = 123 inches, but when i put the 312 i get 26...weird!!
"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack