Initial Commit

This commit is contained in:
root
2023-10-23 18:07:52 +00:00
commit 1923748144
11 changed files with 126 additions and 0 deletions

14
calc.cpp Normal file
View File

@@ -0,0 +1,14 @@
using namespace std;
extern "C" double hole_calc(double volume, double diameter)
{
// Convert diameter to radius
double radius = diameter / 2.0;
//Calculate the volume in cubic inches
double volumeInCubicInches = volume * 1728.00;
// Calculate the depth using the volume, radius, and pi
double depth = volumeInCubicInches / ((radius * radius) * 3.141592);
return depth;
}