Click here to Skip to main content
Click here to Skip to main content

BAC Calc

By , 29 Nov 2004
 

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

About the Author

Adam McKee
Software Developer (Senior)
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 

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

You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionCode Comments? Pinmemberkusokurae2 Dec '04 - 15:41 
i was just thinking... how does my code look? does it look as if it were written by a 3 year old? their isn't much code to be seen, but what about my other project, 'Subliminal Messaging', i was in about the same mindset for that one. specifically, as i was looking at diesel_travis's addition and i noticed that i use really stupid variable names. anyone else have that thought, or do i just need to find something else to think about while i'm in class?
(yes, i'm in class at the time of this writing)
Questionam i drunk or not? Pinmemberdiesel_travis30 Nov '04 - 10:09 
it'd be neat if it had a graph showing your level of drunkenness, ranging from sober all the way up to fatal. I have no idea what BAC I am officially drunk.
AnswerRe: am i drunk or not? Pinmemberstrtdusty30 Nov '04 - 12:08 
GeneralRe: am i drunk or not? Pinsussleewsimpson1 Dec '04 - 7:06 
0.08 or 0.1 depending.
GeneralRe: am i drunk or not? Pinsussleewsimpson1 Dec '04 - 7:06 
Answer...I just added extra labels to my version... Pinmemberdiesel_travis1 Dec '04 - 11:17 
GeneralRe: ...I just added extra labels to my version... Pinmemberdiesel_travis1 Dec '04 - 11:20 
GeneralRe: ...I just added extra labels to my version... Pinmemberkusokurae2 Dec '04 - 14:58 
Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 30 Nov 2004
Article Copyright 2004 by Adam McKee
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid