Question: [In JGrasp Java language format] We are to write a program calculating the amount of beer they have in all of the containers using the
[In JGrasp Java language format]
We are to write a program calculating the amount of beer they have in all of the containers using the variables b, keg, and Hhd. I need to write a program displaying the sum and total volume in barrels.
There are:
31.0 gallons in a barrel
15.5 gallons in a keg
54.0 gallons in a hogshead
![[In JGrasp Java language format] We are to write a program calculating](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39d977e73f_62266f39d96ecd94.jpg)
COMP163 Brewery Barrels A brewery has a large inventory of beer in partially filled containers. You are to write a program that calculates how much beer they have in all containers combined. The data file brewery.txt contains a list of numbers representing the volume of beer in a container. Each line of the file contains a number with a decimal point followed by the unit of measurement. The units can be barrel (represented by "b"), keg (represented as "keg") or hogshead (represented by "Hhd"). The units might be in a mixture of upper and lower case letters. A. [90 points] Write a program that sums the volume of all containers and displays the total volume in barrels. There are 31 gallons in a barel, 15.5 gallons in a keg and 54 gallons in a hogshead B. [10 points] Display the sum of the beer volume with only three decimal digits of accuracy Sample output The total volume is 165. 63381299188708 barrels or The total volume is 165.634 barrels Upload your completed program to Blackboard before the end of your lab period
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
