Cpp Code for Blood Alcohol

This cpp programming code is used to find the blood alcohol. You can select the whole cpp code by clicking the select option and can use it. When you click text, the code will be changed to text format. This cpp program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this cpp code and use it to find the blood alcohol.

#include<iostream>
using namespace std;

int main(void)
{

    float AC;
    float BAC=24.5;
    float timehr=26.3;
    float male,female;
    float wt=56;
    int Ethanol_per=100;
    float resbeer,ozbeer,reswine,ozwine,resspirit,ozspirit;

	float bachr = BAC + (timehr * 20);

male = (bachr * wt) / (1.22 * 100);
female = (bachr * wt) / (1.51 * 100);

cout<<"\nMale Patient:";

resbeer = male / 0.05;
ozbeer = resbeer / 29.59;
reswine = male / 0.12;
ozwine = reswine / 29.59;
resspirit = male / 0.4;
ozspirit = resspirit / 29.59;
cout<<"\nBeer (5percent ethanol) "<<resbeer<<" mL "<<ozbeer<<" oz";
cout<<"\nWine (12percent ethanol) "<<reswine<<" mL "<<ozwine<<" oz";
cout<<"\nSpirit (40percent ethanol) "<<resspirit<<" mL "<<ozspirit<<" oz";

cout<<"\nFemale Patient:";

resbeer = female / 0.05;
ozbeer = resbeer / 29.59;
reswine = female / 0.12;
ozwine = reswine / 29.59;
resspirit = female / 0.4;
ozspirit = resspirit / 29.59;

cout<<"\nBeer (5percent ethanol) "<<resbeer<<" mL "<<ozbeer<<" oz";
cout<<"\nWine (12percent ethanol) "<<reswine<<" mL "<<ozwine<<" oz";
cout<<"\nSpirit (40percent ethanol) "<<resspirit<<" mL "<<ozspirit<<" oz";

return 0;
}
Other Programming Codes
Online Calculator : Blood Alcohol
Click on the select code link to copy and paste this free cpp program code for blood alcohol.

english Calculators and Converters


Sitemap