Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions