Soo.. I\'m writing a pentagon project for my c++ class, and to be honest I\'m not really doing well right now due job and other classes. So.. we need to make a pentagon program
I take it that you're just confused about translating math syntax into code.
Your equation for area:
s^2*sqrt(25+10(sqrt(5)))/4
Goes like this in C++:
double area = s * s * sqrt(25.0 + 10.0 * sqrt(5.0)) / 4.0;
After that, you have an error:
return area;
The ProcessCommand
function is void
, which means you can't return a value. It wouldn't make sense to do so anyway. Perhaps you want to output it with std::cout
instead.