So I can't figure out how to change my result into an exact decimal.
My problem is that the tan function returns 1 instead of like 1.37etc...
#define Pi double(3.14159)
using namespace std;
void Switch(double x, double y, double z, char Type)
int h = 0;
cout << "\n\tThe Area of the Equilateral is = " << 1.0/2.0 * x * sqrt(x*x -(x/2)*(x/2));
cout << "\n\tThe Area of the Square is = " << x * x;
h =tan(54 * Pi/180);
cout << "\n\tThe Height is = " << h;
cout << "\n\tinvalid entry";
I tried making them all into double by puting .0 at end of each number, i.e. 180.0. That didn't work
I also tried removing the #define Pi and putting instead in my code, double Pi = 3.14159. That didn't work either.
Any simple suggestions? I am only in a beginning c++ class mind you so the simpler the suggestion the better.