Define a Beer class that contains the following instance variables with accessors/ mutators:
String name; // The name of the beerdouble alcohol; // The percent alcohol of the beer, e.g. 0.05 for 5%
Add the following method:
// This method returns the number of drinks that a person
// of (weight) pounds can drink using the alcohol percentage
// in the beer, assuming a drink of 12 ounces. This is an
// estimate. The method assumed that the legal limit is 0.08 blood
// alcohol.
public double intoxicated(double weight){ double numDrinks; // This is a simplification of the Widmark formula numDrinks = (0.08 + 0.015) * weight / (12 * 7.5 * alcohol); return numDrinks;}Write code in a main method that creates two Beer objects with different alcohol percentages. Invoke the intoxicated method for a light individual and a heavy individual and output the estimated number of drinks to become legally intoxicated.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.