Click here to Skip to main content
15,868,340 members
Articles / Programming Languages / C#
Article

BAC Calc

Rate me:
Please Sign up or sign in to vote.
1.33/5 (14 votes)
29 Nov 2004 58.1K   589   14   8
Blood-alcohol level calculator.

Sample Image

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionCode Comments? Pin
ARMWare2-Dec-04 15:41
ARMWare2-Dec-04 15:41 
Questionam i drunk or not? Pin
diesel_travis30-Nov-04 10:09
diesel_travis30-Nov-04 10:09 
AnswerRe: am i drunk or not? Pin
strtdusty30-Nov-04 12:08
strtdusty30-Nov-04 12:08 
I'm sure the legal limit depends on the state you live in (State as in united states, not state as in the state of drunkenness)
GeneralRe: am i drunk or not? Pin
leewsimpson1-Dec-04 7:06
leewsimpson1-Dec-04 7:06 
GeneralRe: am i drunk or not? Pin
leewsimpson1-Dec-04 7:06
leewsimpson1-Dec-04 7:06 
Answer...I just added extra labels to my version... Pin
diesel_travis1-Dec-04 11:17
diesel_travis1-Dec-04 11:17 
GeneralRe: ...I just added extra labels to my version... Pin
diesel_travis1-Dec-04 11:20
diesel_travis1-Dec-04 11:20 
GeneralRe: ...I just added extra labels to my version... Pin
ARMWare2-Dec-04 14:58
ARMWare2-Dec-04 14:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

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