Problem 44939. What time can I drive after drinking?
At T o'clock, after a hard day of Matlab, I immediately start drinking and treat myself to N pints of tasty beer. Each beer I drink has 3 standard units (strong beer - ~5.2%) and my body processes 1 unit of alcohol each hour (the average). Assume all beer is consumed instantly.
In England the legal limit for driving is approximately 2 units of alcohol in your blood, assuming this at what time can I legally drive again?
The input N is number of beers drank and T the time I start drinking (as a 24 hour integer). The output H is the hour I may drive again (24 hour integer) and the output Y is how many days (where 0 is the same day, 1 is the following day etc).
E.g. If I drink 1 beer (N=1) at 7 pm (T=19), 1 of the units will be processed in 1 hour and I can 'safely' drive with 2 units in my blood. The output is D=0, H=20.
https://www.nhs.uk/common-health-questions/lifestyle/how-long-does-alcohol-stay-in-your-blood/
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Rotate input square matrix 90 degrees CCW without rot90
594 Solvers
-
Find Index of maximum Value and maximum Value of a vector
160 Solvers
-
395 Solvers
-
685 Solvers
-
Factorions: Numbers that equal the sum of the factorials of their digits
67 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!