Dear Friends,
My interest are mathematics, C++ programation and, of course, alcoholic
beverages. Since I saw this marvellous site I decided to make a little
contribution, so, I write this C++ Borland-based little program who calculates
the tax of alcohol (in mililitres) according to the percentage of alcohol
contained in each total beverage volume (too in mililitres).
Below I wrote the program's source code. This program runs in any computer
by the saving of it's text as .exe (C++ executable program) and executing it.
Note, by the source code, it's very simple program who uses the Borland
libraries called STDIO AND CONIO. This program don't use the MATH library
because it only perform very simply calculations for get the final answer.
The name I give to it is CalculAlcool (or CalculAlcohol on the english
version). More C++ utilitary source codes you can find at my webpage on
WWW.ROMANAO.CJB.NET. Thanks!
_________________________________________________________________________________
#include <stdio.h>
#include <conio.h>
void main (void)
{
float a,b,c;
//appear program's informations and ask screen
printf ("CalcuAlcohol Program 1.0 - CPD/UNIFEI");
printf ("\nBy Mario Henrique Romano Bernardes");
printf ("\nGet your copy! www.romanao.cjb.net");
getch();
printf ("\n\nALCOHOLIC GRADES OF SOME BEVERAGES ");
//create and show standard table for alcohol contents of some beverages
printf ("\nbeer...............................00%");
printf ("\nvodka..............................00%");
printf ("\nwhiskey............................00%");
printf ("\nbrazilian cachaca..................00%"); getch();
//the below lines asks operator for to put the needed datas about the drink
printf ("\n\nType the total volume of the bottle!........: ");
scanf ("%f",&a);
printf ("Type the alcoholic grade of the drink!......: ");
scanf ("%f",&b);
//the formula below calculates the alcoholic volume using the data above
c=b*a/100;
//the code line below outputs the alcoholic volume of the typed datas above
printf ("The total alcohol grade of the beverage is..: %f mililitres", c);
getch();
//the code line below prints an humorate message concerning alcohol abuse
printf ("\n\nTAKE EASY WITH THE DRINKS!!!");
getch();
}
_________________________________________________________________________________