This is a function definition:
Code:
double unitprice(int diameter, double price)
{
   const double PI = 3.14159;
   double radius, area;

   radius = diameter/static_cast<double>(2);
   area = PI * radius * radius;
   return (price/area);
}
It will serve as a declaration if it precedes the call. This is also a definition, but it is not a function.
Code:
double unitprice;
So, do you want "unitprice" to be a double or a function? WE don't know. YOU are supposed to know and write the code appropriately.