Question: 2) Write a function that calculates and returns the level of alcohol concentration in the blood for a person who has been drinking (BAC). There

 2) Write a function that calculates and returns the level of

2) Write a function that calculates and returns the level of alcohol concentration in the blood for a person who has been drinking (BAC). There are several ways to calculate this value, but in this exercise the following formula will be used: BAC 0015 . t + 0.0165 r.w where: A- alcohol consumed (in grams) w body mass (in hectograms) t time since the first drink (in hours) r-constant that represents the fraction of the body mass in which alcohol could be present: 0.68 for men, 0.55 for women Note that r is different for men and for women, so you need an if that asks if the sex of the person is 'F (female) or 'N' (male) to assign the value to the variable r that will be used in the formula: 0.55 or 0.68, respectively. This function has the purpose of calculating the BAC only, so he needs to be provided with (the values of A, w, t and the sex of the person who has been drinking (F' or 'N'). The variable sex is char *Note: Only the function that does what is described here is requested, not the complete program

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!