1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#include <iostream>
#include <iomanip>
using namespace std;
void PoolSize(float Length, float Width, float Depth, float &Gallons, float &CubicFeet);
void FillTime(float Gallons, float FillRate);
void main ()
{
float Length;
float Width;
float Depth;
float CubicFeet;
float FillRate;
float Gallons;
cout << "Insert the length: ";
cin >> Length;
cout << "Insert the width: ";
cin >> Width;
cout << "Insert the depth: ";
cin >> Depth;
PoolSize(Length, Width, Depth, Gallons, CubicFeet);
cout << "Insert the fill rate of the pool in gallons per minute: ";
cin >> FillRate;
cout << "\n";
FillTime(Gallons, FillRate);
system("pause");
}
//////////////////////////////Volume & Capacity///////////////////////////////////////////
void PoolSize(float Length, float Width, float Depth, float Gallons, float CubicFeet)
{
CubicFeet = (Length*Width*Depth);
cout << "The volume of the pool is: "<< CubicFeet << "\n\n";
const int conversion = 7.48051948;
Gallons = (CubicFeet*conversion);
cout << "The capacity in gallons for this pool is: " << Gallons <<"\n\n";
}
//////////////////////////////////Fill Time///////////////////////////////////////////////
void FillTime(float FillRate, float Gallons)
{
float 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";
}
|