Blood Alcohol Content Calculation

1.

2. Enter number of drinks consumed:

3. Enter kind of drinks consumed:

4. Enter hours passed since first drink:
5. Enter weight (in pounds):

0 && strlen($num_drinks) > 0 && strlen($alc_kind) > 0 && strlen($time_consumed) > 0 && strlen($weight_lbs) > 0) { $drinks = doubleval($num_drinks); if ($alc_kind == "beer") { $alcohol = $drinks * .42; } elseif ($alc_kind == "wine") { $alcohol = $drinks * .6; } elseif ($alc_kind == "liquor") { $alcohol = $drinks * .5; } else { $alcohol = 0; } $weight = doubleval($weight_lbs); $time = doubleval($time_consumed); if ($gender == "female") { $factor = 10; } elseif ($gender == "male") { $factor = 8; } $beta = 0.017; $part1 = (($alcohol * $factor) / $weight); $part2 = ($time * $beta); $bac = 0; if ($part1 > $part2 && $part2 != 0) { $bac = $part1 - $part2; } $realbac = sprintf("%0.03f",$bac); if ($bac > 0) { echo "Blood Alcohol Content: "; echo ""; echo $realbac; echo "%"; echo ""; } else { echo "Your values resulted in a BAC very close to zero."; } } else { echo "Enter values, then press Calculate to get the Blood Alcohol Content."; } ?>

0) { ?>
Blood Alcohol Content and Behavior

Special thanks to Ed Kuwatch and the California Drunk Driving Law site for assistance in developing this BAC calculator.