Question: Hi, I am asked to modify the program (see below) so that the input value (inches) is read (output value) int feet and inches, rather

Hi,

I am asked to modify the program (see below) so that the input value (inches) is read (output value) int feet and inches, rather than just inches. I am then asked to modify the input value so that it reads feet and inches and the output value is also in feet and inches. I have tried (unsuccessfully) to use Fmod but I still think that this is one way to approach the problem. The program is measuring bones in inches to determine femur and humerus lengths.

/*Length and Height calculation based on the length of the femur and humerus.*/

#include

#include

int main()

{

/* Declare Variables */

double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f, humerus_ht_m;

/* User Input */

printf("Enter Values in inches ");

printf("Enter femur length: ");

scanf("%lf", &femur);

printf("enter humerus length: ");

scanf("%lf", &humerus);

/* Compute height */

femur_ht_f = ((femur*12)*1.94 + 28.7)/12;

femur_ht_m = ((femur*12)*1.88 + 32)/12;

humerus_ht_f = ((humerus*12)*2.8 + 28.2)/12;

humerus_ht_m = ((humerus*12)*2.9 + 27.9)/12;

/* Print Height Estimates */

printf(" Height Estimates in Feet ");

printf(" Femur Female: %5.1f ", femur_ht_f);

printf(" Femur Male: %5.1f ", femur_ht_m);

printf(" Humerus Female: %5.1f ", humerus_ht_f);

printf(" Humerus Male: %5.1f ", humerus_ht_m);

/* Exit Program */

return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!