13,052,022 members (64,451 online)
alternative version

#### Stats

46.9K views
14 bookmarked
Posted 29 Nov 2004

# BAC Calc

, 29 Nov 2004
 Rate this:
Blood-alcohol level calculator.

## Introduction

A handy-dandy blood-alcohol calculator. Obviously, this isn't to be used as an accurate measuring device, just rough estimate.

## Background

Found a picture here that had a BAC formula, so I coded it for weekend use.

## Using the code

Change the values as needed, your estimated BAC will update automagically. Here's the formula, for the curious.

```(Number of drinks / 2) * (9 / Weight for Men  OR 7.5 /
Weight for Women) - (.016 * Hours Drinking) = BAC```

## Points of Interest

Setting all controls on the forms' 'value changed' (or equivalent) to the same '`calc()`' function made for little code.

A list of licenses authors might use can be found here

## Share

 Software Developer (Senior) United States
No Biography provided

## You may also be interested in...

 View All Threads First Prev Next
 am i drunk or not? diesel_travis30-Nov-04 10:09 diesel_travis 30-Nov-04 10:09
 Re: am i drunk or not? strtdusty30-Nov-04 12:08 strtdusty 30-Nov-04 12:08
 Re: am i drunk or not? leewsimpson1-Dec-04 7:06 leewsimpson 1-Dec-04 7:06
 Re: am i drunk or not? leewsimpson1-Dec-04 7:06 leewsimpson 1-Dec-04 7:06
 ...I just added extra labels to my version... diesel_travis1-Dec-04 11:17 diesel_travis 1-Dec-04 11:17
 // NYS legal limits // http://www.nydmv.state.ny.us/broch/c39.htm if (temp >= 0.08) { // DWI lblNYS.Text = "NYS: DWI"; } else { if (temp >= 0.05) { // DWAI lblNYS.Text = "NYS: DWAI"; } else { lblNYS.Text = "NYS: OK!"; } // Under 21 if (temp >= 0.02) { // Zero tolerance lblNYS.Text += "; < 21 Zero Tolerance"; } } // additional CDL limits if (temp >= 0.07) { // Per Se Level II lblNYS.Text += "; CDL: P.S.L. II"; } else if (temp >= 0.04) { // Per Se Level I lblNYS.Text += "; CDL: P.S.L. I"; } // Physical Reactions // http://www.nvo.com/beaulier/theeffectsofalcohol/ // http://www.ou.edu/oupd/bac.htm if (temp >= 4) { // YOU ARE DEAD. lblDrunk.Text = "Death X-("; } else if (temp >= 0.40) { // Onset of coma, and possible death due to respiratory arrest. lblDrunk.Text = "Coma |-{"; } else if (temp >= 0.35) { // Coma is possible. This is the level of surgical anesthesia. // You fall unconsciousness and begin to have breathing difficulties. You are at serious of suffering brain damage or dying. lblDrunk.Text = "Possible Coma |-("; } else if (temp >= 0.30) { // STUPOR. You have little comprehension of where you are. You may pass out suddenly and be difficult to awaken. // You are at dangerous levels of intoxication. You are in a black out and are not in control of your behaviors. lblDrunk.Text = "Stupor ;-/"; } else if (temp >= 0.25) { // All mental, physical and sensory functions are severely impaired. Increased risk of asphyxiation from choking on vomit and of seriously injuring yourself by falls or other accidents. lblDrunk.Text = "Severely Drunk ;-O"; } else if (temp >= 0.20) { // Feeling dazed/confused or otherwise disoriented. May need help to stand/walk. If you injure yourself you may not feel the pain. Some people have nausea and vomiting at this level. The gag reflex is impaired and you can choke if you do vomit. Blackouts are likely at this level so you may not remember what has happened. // You are extremely intoxicated and probably cannot spell car let alone drive one. You may experience problems speaking and have a serious loss of balance. lblDrunk.Text = "Confused Drunk ;-?"; } else if (temp >= 0.16) { // Dysphoria predominates, nausea may appear. The drinker has the appearance of a "sloppy drunk." lblDrunk.Text = "Sloppy Drunk ;-|"; } else if (temp >= 0.15) { // At this stage you are very drunk. Memory loss may occur. You may feel nausea and sleepy. You are unable to perform simple tasks and may slur your words lblDrunk.Text = "Very Drunk :-P"; } else if (temp >= 0.13) { // Gross motor impairment and lack of physical control. Blurred vision and major loss of balance. Euphoria is reduced and dysphoria* is beginning to appear. Judgment and perception are severely impaired. (* —Dysphoria: An emotional state of anxiety, depression, or unease.) lblDrunk.Text = "Blurry Drunk :-}"; } else if (temp >= 0.10) { // Muscle control and balance is greatly reduced. You may react to outside stimulus emotionally. lblDrunk.Text = "Drunk "; } else if (temp >= 0.08) { // Reaction time is greatly reduced and memory is weakened. lblDrunk.Text = "Legally Drunk "; } else if (temp >= 0.05) { // Inhibitions start to disappear and you "loosen up." lblDrunk.Text = "Nealy Drunk "; } else if (temp >= 0.02) { // Reaction time and ability to perform complex tasks is reduced. lblDrunk.Text = "Almost Drunk "; } else { // Sober lblDrunk.Text = "Not Drunk :-/"; }
 Re: ...I just added extra labels to my version... diesel_travis1-Dec-04 11:20 diesel_travis 1-Dec-04 11:20
 Re: ...I just added extra labels to my version... kusokurae2-Dec-04 14:58 kusokurae 2-Dec-04 14:58
 Last Visit: 31-Dec-99 18:00     Last Update: 26-Jul-17 5:23 Refresh 1

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Web02 | 2.8.170713.1 | Last Updated 30 Nov 2004