Write a class called Beer in which it follows this format:
• Instance Variables
. Name
. Alcohol content. Beer is around 0.05 or 5%
• Methodes
. Amason and Mutators the instance variables
• Make sore in the mutator. for the alcohol content contains a check to make sure the value is between 0 and I exclusively.
. Intoxicated
• Takes in a parameter of type double corresponding to weight
• Calculates the number of drinks required to make a person intoxicated based on this fomlula (0.08 0.015) x. Weight / (12 x 7.5 x Alcohol)
• Returns the number of beers it would take before they are .Intoxicated
Next write another class
• Contains a main method
• Creates two instances of the type Beer
• Have the user enters in the name and alcohol contents for both
• Next enter in a weight value and it calculates how many drinks it would take for a person at that weight to become intoxicated
• Print out the results
Example Output
Let's Party! Responsibly...
What's the name of the first beer?
Pabst Blue Hipster
What's the alcoholic content?
0.05
What's the name of the second beer?
Moo Brew
What's the alcoholic content?
0.08
What's the weight of the person consuming said beverages? 150
It would take 3.166 Pabst Blue Hipster beers to become intoxicated. It would take 1.979 Moo Brew beers to become intoxicated.
Later Tater