Blood alcohol content (BAC) is a measure of how much alcohol is in someone’s blood. It is usually measured as a percentage, so a BAC of 0.3% is three-tenths of one percent. That is, there are 3 grams of alcohol for every 1,000 grams of blood. A BAC of 0.05% impairs reasoning and the ability to concentrate. A BAC of 0.30% can lead to a blackout, shortness of breath, and loss of bladder control. In most states, the legal limit for driving is a BAC of 0.08%. BAC is usually measured by a breathalyzer, urinalysis, or blood test. However, Swedish physician E. M. P. Widmark developed the following equation for estimating an individual’s BAC. This formula is widely used by forensic scientists. B = -0.015*t+(2.84*N/W*g) The variables in the formula are defined as: B = percentage of BAC N = number of “standard drinks” (N should be at least 1) (NOTE: A standard drink is one 12-ounce beer, one 5-ounce glass of wine, or one 1.5-ounce shot of distilled liquor.) W = weight in pounds g = gender constant, 0.68 for men and 0.55 for women t = number of hours since the first drink Write a C++ computer program that prompts your user for the elements needed to estimate Blood Alcohol Content using the Widmark formula above. The program should allow your user to continue to make Blood Alcohol Content estimates until they enter a sentinel value. Be sure to inform your user what that sentinel value is. Validate all the user input values. Use the following table to determine which of the possible effects corresponds to the BAC value that was calculated. BAC Estimate Possible Effects Less Than 0.03% Normal behavior, no impairment 0.03% or greater, but less than 0.06% Mild euphoria and impairment 0.06% or greater, but less than 0.10% Euphoric, increased impairment 0.10% or greater, but less than 0.20% Drunk, loss of motor control 0.20% or greater, but less than 0.30% Confused, possible blackout 0.30% or greater, but less than 0.40% Possibly unconscious 0.40% or greater Unconscious, risk of death Your program should display the BAC value and the possible effects that correspond to that value. The legal limit for driving is a BAC of 0.08%. If the BAC value is 0.08% or greater, your program should also display a phrase like “Over the legal limit for driving.”

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Blood alcohol content (BAC) is a measure of how much alcohol is in someone’s blood. It is usually measured as a percentage, so a BAC of 0.3% is three-tenths of one percent. That is, there are 3 grams of alcohol for every 1,000 grams of blood. A BAC of 0.05% impairs reasoning and the ability to concentrate. A BAC of 0.30% can lead to a blackout, shortness of breath, and loss of bladder control. In most states, the legal limit for driving is a BAC of 0.08%.

BAC is usually measured by a breathalyzer, urinalysis, or blood test. However, Swedish physician E. M. P. Widmark developed the following equation for estimating an individual’s BAC. This formula is widely used by forensic scientists.

B = -0.015*t+(2.84*N/W*g)

The variables in the formula are defined as:

B = percentage of BAC

N = number of “standard drinks” (N should be at least 1)

(NOTE: A standard drink is one 12-ounce beer, one 5-ounce glass of wine, or one 1.5-ounce shot of distilled liquor.)

W = weight in pounds

g = gender constant, 0.68 for men and 0.55 for women

t = number of hours since the first drink

Write a C++ computer program that prompts your user for the elements needed to estimate Blood Alcohol Content using the Widmark formula above.

The program should allow your user to continue to make Blood Alcohol Content estimates until they enter a sentinel value. Be sure to inform your user what that sentinel value is. Validate all the user input values. Use the following table to determine which of the possible effects corresponds to the BAC value that was calculated.

BAC Estimate

Possible Effects

Less Than 0.03%

Normal behavior, no impairment

0.03% or greater, but less than 0.06%

Mild euphoria and impairment

0.06% or greater, but less than 0.10%

Euphoric, increased impairment

0.10% or greater, but less than 0.20%

Drunk, loss of motor control

0.20% or greater, but less than 0.30%

Confused, possible blackout

0.30% or greater, but less than 0.40%

Possibly unconscious

0.40% or greater

Unconscious, risk of death

Your program should display the BAC value and the possible effects that correspond to that value.

The legal limit for driving is a BAC of 0.08%. If the BAC value is 0.08% or greater, your program should also display a phrase like “Over the legal limit for driving.”

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education