Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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= 0.0 15. t+ 0.0165 where: A-alcohol consumed (in grams) w = body mass (in hect grams) ttime 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 the variable 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 lused in the formula: 0.55 or 0.68, respectively This function has the purpose of calculating the BAC only, so the values of A, w, t and the sex of the person who has been drinking (F' or 'N') need to be provided. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started