Question
The C++ Distillery produces an excellent whiskey that is blended from a combination of mash and corn, aged in oak barrels for at least two
The C++ Distillery produces an excellent whiskey that is blended from a combination of mash and corn, aged in oak barrels for at least two years. The whiskey is filtered through charcoal and bottled in one and a half-liter bottles. You are going to write a program to help the distillery owner to order the correct number of bottles needed for the whiskey that is aged in barrels. The aging barrels are cylindrical and range in size.
The traditional method of aging is in oak barrels over years. There is s loss of volume due to evaporation from 2 15 %, depending on how many years the barrel will be aged, as well as other factors like temperature and humidity. The new and improved method uses stainless steel barrels with charred oak chips added to the whiskey. There is no volume loss with this method of aging.
The program will first show your class header by calling the Header function and then begin a do while loop. In this loop the program will call the functions listed below, requesting information, calculating, and presenting information to the customer. You will need these functions:
The C++ Distillery produces an excellent whiskey that is blended from a combination of mash and corn, aged in oak barrels for at least two years. The whiskey is filtered through charcoal and bottled in one and a half-liter bottles. You are going to write a program to help the distillery owner to order the correct number of bottles needed for the whiskey that is aged in barrels. The aging barrels are cylindrical and range in size. The traditional method of aging is in oak barrels over years. There is s loss of volume due to evaporation from 2 15 %, depending on how many years the barrel will be aged, as well as other factors like temperature and humidity. The new and improved method uses stainless steel barrels with charred oak chips added to the whiskey. There is no volume loss with this method of aging. The program will first show your class header by calling the Header function and then begin a do while loop. In this loop the program will call the functions listed below, requesting information, calculating, and presenting information to the customer. You will need these functions:
The AskName function gets the name of the whiskey. The AskForBarrels function obtains the inside diameter, height (in inches), the number of aging barrels and the amount of loss due to aging. For oak barrels, the amount of loss is a percentage between 2 and 15. Ask the user to enter 0 for stainless steel barrels (no loss). All values are numeric. You may assume the diameter and height are in whole inches. Pass using References for this function. There are two functions called CalcNetWhiskeyVol, one for stainless steel barrels (no loss) and one for oak barrels (loss between 2 and 15%). These functions are overloaded. The first CalcNetWhiskeyVol function is passed the dimensions of the barrels and the number of barrels only. The second CalcNetWhiskeyVol function is additionally passed the agingLoss, an int representing the percentage lost. Use the information to determine the total volume of whiskey in gallons. The function returns a floating point value (use either float or double). You can pass variables by value or use references for these functions. The whiskey volume is passed to the DetermineBottles function which calculates the number of total number of cases (twelve bottles to a case), total bottles produced, and left over total full bottles. You can assume the bottling crew polishes off the remaining partial bottle in celebration of finishing the job. :-) Keep track of this amount, too. For example, if the total bottle production was 38.75 bottles, then there were 38 total bottles resulting in 3 full cases, 2 left over bottles, and the crew sampled of a bottle, or 1.125 liters of whiskey. (Lets hope it is a large crew!!!) Pass by Reference using pointers for this function. The WriteResults function is passed call by value all of the information and writes it to the screen. You should display the Whiskey Name, the dimensions of the barrel, the total volume of whiskey, the aging loss (if any), and the total volume of whiskey minus the loss (in gallons), the total number of cases, total bottles produced, the leftover total full bottles, and the percentage of the crew treat. When the customer is finished, present a goodbye message. Be sure to call ALL of the functions from main. Use pointers and references as described. NOTE: do not use stringstream or arrays to return values to main! | |||||||||||||||||||||||||||||||||||
The AskName function gets the name of the whiskey.
The AskForBarrels function obtains the inside diameter, height (in inches), the number of aging barrels and the amount of loss due to aging. For oak barrels, the amount of loss is a percentage between 2 and 15. Ask the user to enter 0 for stainless steel barrels (no loss). All values are numeric. You may assume the diameter and height are in whole inches. Pass using References for this function.
There are two functions called CalcNetWhiskeyVol, one for stainless steel barrels (no loss) and one for oak barrels (loss between 2 and 15%). These functions are overloaded.
The first CalcNetWhiskeyVol function is passed the dimensions of the barrels and the number of barrels only. The second CalcNetWhiskeyVol function is additionally passed the agingLoss, an int representing the percentage lost. Use the information to determine the total volume of whiskey in gallons. The function returns a floating point value (use either float or double). You can pass variables by value or use references for these functions.
The whiskey volume is passed to the DetermineBottles function which calculates the number of total number of cases (twelve bottles to a case), total bottles produced, and left over total full bottles. You can assume the bottling crew polishes off the remaining partial bottle in celebration of finishing the job. :-) Keep track of this amount, too. For example, if the total bottle production was 38.75 bottles, then there were 38 total bottles resulting in 3 full cases, 2 left over bottles, and the crew sampled of a bottle, or 1.5 liters of whiskey. (Lets hope it is a large crew!!!) Pass by Reference using References for this function.
The WriteResults function is passed call by value all of the information and writes it to the screen. You should display the Whiskey Name, the dimensions of the barrel, the total volume of whiskey, the aging loss (if any), and the total volume of whiskey minus the loss (in gallons), the total number of cases, total bottles produced, the leftover total full bottles, and the percentage of the crew treat.
When the customer is finished, present a goodbye message.
Be sure to call ALL of the functions from main. Use pointers and references as described. NOTE: do not use stringstream or arrays to return values to main!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started