Finding a Centroid of a 2D Element using C++
You are to write, compile and execute a C++ code to calculatethe centroid (x, ¯ y¯) of the following element given in Figure 1.The formulas for determining the centroid are given as

You could select either dA = ydx and/or dA = xdy to set up theintegration. Calculate the centroid using a numerical integrationtechnique such as the trapezoidal or the Simpson’s rule. Using yourcode, please calculate the following:
1. Estimate the centroid (x, ¯ y¯) by dividing the elements into10 equal subelements in x and y directions.
2.
PayPal Gateway not configured
PayPal Gateway not configured