Question: Problem 2 ( 1 point ) John has a body mass of 7 5 kg ; he started drinking at 8 pm , and consumed

Problem 2(1 point)
John has a body mass of 75 kg ; he started drinking at 8 pm , and consumed five beers by 10 pm , when he stopped drinking.
Complete the code below to calculate John's BAC at midnight, assuming that he started drinking on empty stomach (round to three decimal places). Note
that one beer counts as one drink.
In ]:A = # look at the above formula: 0.1* mass of alcohol consumed
r = # Widmark factor
W = # body mass
B = # Note: Python cannot use Greek symbols for variables and parameters, so we use B instead.
t = # time from start of drinking to midnightBAC = A/(rW)-Bt
print("John's alcohol concentration at midnight is", BAC, "percent per volume.")
print()Suppose we would like to find the time when John's blood alcohol concentration drops below 0.05.
The code below creates a table of values for BAC and plots it over the interval 0,12, where t=0 represents 8pm, the time when John started drinking.
(Notice that this model stops making biological sense after about t=8.)
Keep in mind that t and BAC are given as arrays, and that you can access particular values using indices (just like with lists). For example, t [23] refers to the
24th value of t in the array whereas BAC [51] refers to the 52 nd value of BAC in the array. (If you do not remember this, go back and review Lab 0).In []: # plot BAC on the interval [0,12]
a =0 # do not change this
b =12 # do not change this
n =720 # do not change this
t = np.linspace(a,b,n) # t is the independent variable; we're building a table of values for BAC!
BAC = A/( rt # this completes the table of values for BAC
plt.plot(t,BAC)
plt.title("John's blood alcohol level")
plt.xlabel('t (t=0 represents 8pm)')
plt.ylabel('BAC')
plt.grid()
plt.show()Hint 2: The graph is meant to help you narrow down the ordered pairs you need to print! No need to print 720 ordered
Problem 3(1 point)
Examine the table of values for BAC to find the time when John's BAC falls below 0.05 for the first time.
Fill in the blank:
John's BAC falls below 0.05 for the first time 5 hours and ------minutes (round off to the nearest integer minute) after 8 pm .
Problem 2 ( 1 point ) John has a body mass of 7 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!