September 2015
Beginner
110 pages
2h 6m
English
| 17 | Blood Alcohol Calculator |
Sometimes you have to perform a more complex calculation based on some provided inputs and then use that result to make a determination.
Create a program that prompts for your weight, gender, number of drinks, the amount of alcohol by volume of the drinks consumed, and the amount of time since your last drink. Calculate your blood alcohol content (BAC) using this formula
where
A is total alcohol consumed, in ounces (oz).
W is body weight in pounds.
r is the alcohol distribution ratio:
0.73 for men
0.66 for women
H is number of hours since the last drink.
Display whether or not it’s legal to drive by comparing the blood ...
Read now
Unlock full access