Java Code for Blood Alcohol

This java programming code is used to find the blood alcohol. You can select the whole java code by clicking the select option and can use it. When you click text, the code will be changed to text format. This java 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 java code and use it to find the blood alcohol.

import java.util.*;
import java.lang.*;
class bloodalcohol
{  
    public static void main(String args[])
    {
        
    double AC;
    double BAC=24.5;
    double timehr=26.3;
    double male,female;
    double wt=56;
    int Ethanol_per=100;
    double resbeer,ozbeer,reswine,ozwine,resspirit,ozspirit;

	double bachr = BAC + (timehr * 20);

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

System.out.println("Male 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;
System.out.println("Beer (5percent ethanol) "+resbeer+" mL "+ozbeer+" oz");
System.out.println("Wine (12percent ethanol) "+reswine+" mL "+ozwine+" oz");
System.out.println("Spirit (40percent ethanol) "+resspirit+" mL "+ozspirit+" oz");

System.out.println("Female 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;

System.out.println("Beer (5percent ethanol) "+resbeer+" mL "+ozbeer+" oz");
System.out.println("Wine (12percent ethanol) "+reswine+" mL "+ozwine+" oz");
System.out.println("Spirit (40percent ethanol) "+resspirit+" mL "+ozspirit+" oz");

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

english Calculators and Converters


Sitemap