123456789101112131415161718192021
#include<cmath> const double PI = 4 * atan(1.0); double cylinderVolume(double height, double diameter) { double cylindervol; cylindervol = height * PI * (0.5 * diameter) * (0.5 * diameter); return cylindervol; } double tankWallVolume(double height, double diameter, double thickness) { double tankwallvol; tankwallvol = cylinderVolume - (height * PI * (0.5 * diameter - thickness) * (0.5 * diameter - thickness)); return tankwallvol; }
cylinderVolume
tankwallvol = cylinderVolume( height, diameter ) - ( height * ...