Hello again. Well, I've been trying to get this to work, and I finally was able to combine two functions into one, but now I have to create a new function called FillTime() which will calculate the time to fill to fill the pool, though it seems that it doesnt want to use the already calculated value for float gallons. any help is appreciated.
#include <iostream>
using namespace std;
void PoolSize(float Length, float Width, float Depth, float volume, const float cubicfeet=7.48051948);
void FillTime(float volume, float FillRate, float Minutes);
void main ()
{
float Length;
float Width;
float Depth;
float volume;
const float cubicfeet=7.48051948;
float FillRate;
float Minutes;
cout << "Insert the length: ";
cin >> Length;
cout << "Insert the width: ";
cin >> Width;
cout << "Insert the depth: ";
cin >> Depth;
PoolSize(Length, Width, Depth, volume, cubicfeet);
cout << "Insert the fill rate of the pool in gallons per minute: ";
cin >> FillRate;
cout << "\n";
FillTime(volume, FillRate, Minutes);
system("pause");
}
//////////////////////////////////Fill Time///////////////////////////////////////////////
void FillTime(float gallons, float FillRate, float Minutes)
{
Minutes = gallons/FillRate;
cout <<"The time it takes to fill the pool with a fill rate of "<<FillRate<<" gallons per minute is: "<< Minutes <<" minutes \n\n";
}
//////////////////////////////Volume & Capacity///////////////////////////////////////////
void PoolSize(float Length, float Width, float Depth, float Volume, const float cubicfeet)
{
float gallons;
Volume = (Length*Width*Depth);
cout << "The volume of the pool is: "<< Volume << "\n\n";
gallons = (Volume*cubicfeet);
cout << "The capacity in gallons for this pool is: " <<gallons <<"\n\n";
}