Question

The legal blood alcohol level is .08%. Blood alcohol level largely depends on an individual’s BMI...

The legal blood alcohol level is .08%. Blood alcohol level largely depends on an individual’s BMI and the percentage and amount of whatever it is they consumed. Create a program that could potentially help users estimate how long to wait before driving, if they must drive. Program Description This program will will allow user to create an account. The program will also save the users name, weight, age, and height. It will give the user the option of adding an emergency contact. Create a list of alcohol beverages with their alcohol content. Program will prompt user to choose from list of alcohol beverages for what type of alcohol they are consuming as well as the oz and percentage of alcohol in that drink. The program will use that data which is the weight and alcohol volume to calculate how many drinks they can have to stay under the .08%. If the program estimates that they could be over the alcohol level, it will warn the user. The warning will include links to driving services such as Uber, Lyft, etc. And it will give the user the option to generate a message to their emergency contact. it should be in Python.

Calculating BAC Using the Widmark Formula. Find your formula. The simplified version of the Widmark formula is: BAC = [Alcohol consumed in grams / (Body weight in grams x r)] x 100. In this formula, “r” is the gender constant: r = 0.55 for females and 0.68 for males.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def problemfour():
    try:
        gender = int(input("What is your gender? Enter 1 for Male, 0 for Female"))
        weight = int(input("What is your weight?"))
        drinks = int(input("How many drinks have you had?"))
        volume = int(input("What is the alcohol by volume per drink (in oz)?"))
        time = int(input("When was your last drink(in hours)"))
    except ValueError as e:
        print("You have entered an incorrect value. ")

    total_alcohol = drinks * volume
    #The below changes the ratio depending on if the user is a male or female.
    if gender == 1:
        ratio = 0.68
    else:
        ratio = 0.55

    bac = round((total_alcohol * 5.14 / weight * ratio) - 0.015 * time, 3)
    #The below is used to create only 1 output statement.
    if bac >= 0.08:
        variable = "not "
    else:
        variable = ""
    print("Your BAC is {}".format(bac))
    print("It is {}legal for you to drive".format(variable))

Add a comment
Know the answer?
Add Answer to:
The legal blood alcohol level is .08%. Blood alcohol level largely depends on an individual’s BMI...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This should be in Python Statement : A lot of people drink and drive. The legal blood alcohol lev...

    This should be in Python Statement : A lot of people drink and drive. The legal blood alcohol level is .08%. Blood alcohol level largely depends on an individual’s BMI and the percentage and amount of whatever it is they consumed. This program could potentially help users estimate how long to wait before driving, if they must drive. Program Description This program will: Give the most recent statistics of drinking and driving in California. It will allow user to create...

  • This should be in Python Statement : A lot of people drink and drive. The legal blood alcohol lev...

    This should be in Python Statement : A lot of people drink and drive. The legal blood alcohol level is .08%. Blood alcohol level largely depends on an individual’s BMI and the percentage and amount of whatever it is they consumed. This program could potentially help users estimate how long to wait before driving, if they must drive. Program Description This program will: Give the most recent statistics of drinking and driving in California. It will allow user to create...

  • Create a PHP script that will calculate a person's Blood Alcohol Content (BAC). This program will...

    Create a PHP script that will calculate a person's Blood Alcohol Content (BAC). This program will ask the user for the following variables: • $weight • $gender ... if male, then $ratio = 0.73; if female, then $ratio = 0.66 • $number_of_drinks • $amount_of_alcohol (in ounces) of the drinks consumed (for example, American Beer typically has between 4-6% Alcohol content) • $hours since your last drink The formula to calculate the Blood Alcohol Content (BAC) is as follows: $BAC =...

  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT