This is for a homework assignment, that's why the code has to be written a certain way and contain specific things what I need help with, is I currently have values being input into functions ('volume' in the function containerVolume and 'beer' in the function beer) that I need to use in the main function. Does that make sense?

broken down:

function runs

user input

calculation gives result

function ends

more user input

*this is where I need help*use calculation from function in another calculation in main function

display results

broken down:

function runs

user input

calculation gives result

function ends

more user input

*this is where I need help*use calculation from function in another calculation in main function

display results

Code:

```
// Calculates cost of one ounce of pure alcohol
#include <iostream>
using namespace std;
float proof, volume, beerc, beerv, price, worth, content, ml;
char beeryn; // beer yes or no
char help; // need help converting yes or no
float containerVolume(float volume);
float beer(float beerv);
int main()
{
float proof, volume, beerc, beerv, price, worth, content, ml;
char beeryn; // beer yes or no
char help; // need help converting yes or no
containerVolume(volume); // volume input & conversion
cout << endl;
beer(beerv); // volume calculation for a case of beer
cout << endl;
cout << "Enter the proof: ";
cin >> proof;
cout << "Enter the price: $";
cin >> price;
cout << endl;
content = (volume) * ( proof / 200 );
worth = (price) / (content);
cout << "There are " << content << " ounces of pure alcohol present" << end
l;
cout << " which you are paying for at a rate of $" << worth;
cout << " per ounce of pure alcohol." << endl;
return 0;
}
float containerVolume(float volume)
{
float ml;
cout << "First, do you need help converting from milliliters to ounces?";
cout << " (Y or N): ";
cin >> help;
if ((help == 'Y') || (help == 'y'))
{
cout << "How many milliliters is it? (If calculating for beer ";
cout << "enter volume for one can of beer)";
cin >> ml;
volume = ml * 0.0338140226;
if (ml <= 0)
{
cout << ml << " is not a possible volume! Enter a volume ";
cout << "greater than 0." << endl;
}
else
{
volume = ml * 0.0338140226;
cout << ml << " milliliters is equal to " << volume << " ounces" <<
endl;
}
}
if ((help == 'N') || (help == 'n'))
{
cout << "What is the volume? ";
cin >> volume;
}
return(volume);
}
float beer(float beerv)
{
cout << "Is this beer? (Y or N) ";
cin >> beeryn;
if ((beeryn == 'Y') || (beeryn == 'y'))
{
cout << "Enter number of beers in case: ";
cin >> beerc;
cout << "Enter volume of one can of beer in ounces: ";
cin >> beerv;
volume = beerv * beerc;
}
if (((beeryn == 'N') || (beeryn == 'n')) && ((help == 'N') || (help == 'n')
))
{
cout << "Enter the volume in ounces: ";
cin >> volume;
}
return(volume);
}
```