10 'Programmed October, 1983, in LDOS 5.1.3 LBASIC
20 'W.H.McMicken,M.D., Rydal, PA
30 'Calculate blood alcohol level attained based on body weight,   amount of beverage consumed, percent alcohol in beverage, and   time over which consumed.
40 'NOTE: Percent alcohol = "PROOF" divided by 2; i.e. 80 proof     whiskey is 40% alcohol.
50 'VARIABLES: AL=alcohol content of beverage in %
60 '           AL$=string for "print using"
70 '           AM=amount of beverage in ounces
80 '           PA=percent alcohol level in blood
90 '           T,T1=time variables
100 '           WT=body weight in pounds
110 '           X$=INKEY$ string
120 CLEAR:CLS:PRINT@12,"** PERCENT ALCOHOL IN THE BLOOD **"
130 WT=0:AM=0:AL=0:T1=0
140 PRINT@128,"Enter weight in pounds";:INPUTWT
150 IFWT=0GOTO140
160 PRINT@192,"Enter amount of beverage consumed in ounces ";:INPUTAM
170 IFAM=0GOTO160
180 PRINT@256,"What is the alcohol content of beverage in % ";:INPUTAL
190 IFAL=0GOTO180
200 IFAL>100PRINT@303,"    ":GOTO180
210 PRINT@320,"Over what period of time was this consumed (in hours)";:INPUTT1
220 IFT1=0GOTO210
230 IFT1<=1LETT=0
240 IFT1>1LETT=T1-1
250 LETPA=((AL*AM/50)-T)*3.751/WT
260 PRINT"     Weight :";WT;"lbs."
270 PRINT"     Amount of beverage consumed :";AM;"oz."
280 PRINT"     Alcohol content of beverage :";AL;"%"
290 PRINT"     Period of time for consumption :";T1;:IFT1<=1PRINT"hour"ELSEPRINT"hours"
300 PRINT:AL$="##.##%"
310 IFPA<.0006PRINT"          Percent alcohol in the blood near zero.":GOTO330
320 PRINT"          Percent alcohol in the blood: ";:PRINTUSINGAL$;PA
330 PRINT
340 IFPA<=.05PRINT"          No influence by alcohol under the law."
350 IFPA>.05ANDPA<.1PRINT"          Alcohol influence usually present."
360 IFPA>=.1ANDPA<.3PRINT"          DEFINITE LEGAL EVIDENCE OF UNDER THE INFLUENCE!"
370 IFPA>=.3ANDPA<.4PRINT"          UNDER THE INFLUENCE; MARKED INTOXICATION!"
380 IFPA>=.4ANDPA<.5PRINT"          SEMICOMATOSE; ALCOHOLIC STUPOR!"
390 IFPA>=.5PRINT"          ALCOHOLIC COMA; MAY BE FATAL!"
400 PRINT@960,"    (Type '@' to end program, any other key to rerun.)";
410 X$=INKEY$:IFX$=""GOTO410
420 IFX$="@"CLS:PRINTCHR$(23);:PRINT@320,"Thanks for using this program.":PRINT:PRINT"   Don't drink and drive!!!":GOTO410
430 GOTO120
