C++ Function Definition get the user keyboard values and calculate the cubic feet

Description

C++ Function Definition get the user keyboard values and calculate the cubic feet

#include <iostream>
using namespace std;
get_values(int &length, int &width, int &depth);
calc_cubic(int &length, int &width, int &depth, int &cubic);
print_cubic(int &cubic);
int main()//ww w . ja  v a 2s.c  om
{
   int length, width, depth, cubic;
   get_values(length, width, depth);
   calc_cubic(length, width, depth, cubic);
   print_cubic(cubic);
   return 0;
}
get_values(int &length, int &width, int &depth)
{
   cout << "What is the pool's length? ";
   cin >> length;
   cout << "What is the pool's width? ";
   cin >> width;
   cout << "What is the pool's average depth? ";
   cin >> depth;
   return 0;
}
calc_cubic(int &length, int &width, int &depth, int &cubic)
{
   cubic = (length) * (width) * (depth);
   return 0;
}
print_cubic(int &cubic)
{
   cout << "\nThe pool has " << cubic << " cubic feet\n";
   return 0;
}



PreviousNext

Related