sorry if this is an obvious question but I just started learning computer science.
I have to print the results of this with 14 decimal places so I did so by using %.14f in a printf statement. All of the other variables are integers
double caloriesBurnedW = 0.0175 * 4 * (weight/2.2) * walkingTime;
double caloriesBurnedR = 0.0175 * 10 * (weight/2.2) * runningTime;
double caloriesBurnedMC = 0.0175 * 8 * (weight/2.2) * mountainClimberTime;
The outputs I get are
- 286.36363636363640
- 114.54545454545455
- 229.09090909090910
but they should be
- 286.3636363636364
- 114.54545454545456
- 229.09090909090912