Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 barrel, 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 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 barrel, 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago

Question

Write down the circumstances in which you led.

Answered: 1 week ago