1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int index;
double input1, input2, input3, input4, input5, input6, input7, input8, input9, input10, output, output2, output3, output4, output5, output6, output7, output8, output9, output10;
double a, b, c, d, e, f, g, h, i, j, k, l, m, n, o;
double a1, b1, c1, d1, e1, f1, g1, h1, i1, j1 , k1, l1, m1, n1, o1, p1, q1, r1, s1, t1, u1, v1, w1, x1, y1, z1;
double pi= acos(-1.0);
bool quit, back, back1;
case 3:
do
{
cout << "0. Back\n";
cout << "1. Compute absolute value\n";
cout << "2. Compute square root\n";
cout << "3. Raise to a power\n";
cout << "4. Compute exponential funcation\n";
cout << "5. Compute natural logarithm\n";
cout << "6. Compute common logarithm\n";
cout << "7. Compute sine\n";
cout << "8. Compute cosine\n";
cout << "9. Compute tangent\n";
cout << "10. Compute arc sine\n";
cout << "11. Compute arc cosine\n";
cout << "12. Compute arc tangent\n";
cout << "13. Compute arc tangent with two parameters\n";
cout << "14. Compute hyperbolic sine\n";
cout << "15. Compute hyperbolic cosine\n";
cout << "16. Compute hyperbolic tangent\n";
cout << "17. Round up value\n";
cout << "18. Round down value\n";
back = false;
cin >> index;
switch(index)
{
case 0:
back = true;
break;
case 7:
do
{
cout << "0. Back\n";
cout << "1. Sine (Sin)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1= true;
break;
case 1 :
cout << "Enter a number (in degrees) you would like to compute the sine of:\n";
cin >> h1;
cout << " The sine of " << h1 << " in degrees is " << sin(h1*pi/180)<< "\n";
break;
}
}while(back1 != true);
break;
case 8:
do
{
cout << "0. Back\n";
cout << "1. Cosine (Cos)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1:
cout << "Enter a number (in degrees) you would like to compute the cosine of:\n";
cin >> i1 ;
cout << " The cosine of " << i1 << " in degrees is " << cos(i1 * pi / 180)<< "\n";
break;
}
}while(back1 != true);
break;
case 9:
do
{
cout << "0. Back\n";
cout << "1. Tangent (Tan)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1:
cout << "Enter a number (in degrees) you would like to compute the tangent of:\n";
cin >> j1 ;
cout << " The tangent of " << j1 << " in degrees is " << tan(j1*pi/180)<< "\n";
break;
}
}while(back1 != true);
break;
case 10:
do
{
cout << "0. Back\n";
cout << "1.Arc Sine (asin)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1 :
cout << "Enter a number (in degrees) you would like to compute the arc sine of:\n";
cin >> k1 ;
cout << " The arc sine of " << k1 << " in degrees is " << asin(k1) *180.0 / pi << "\n";
break;
}
}while(back1 != true);
break;
case 11:
do
{
cout << "0. Back\n";
cout << "1.Arc Cosine (acos)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0 :
back1 = true;
break;
case 1 :
cout << "Enter a number (in degrees) you would like to compute the arc cosine of:\n";
cin >> l1 ;
cout << " The arc cosine of " << l1 << " in degrees is " << acos(l1)* 180 / pi << "\n";
break;
}
}while(back1 != true);
break;
case 12:
do
{
cout << "0. Back\n";
cout << "1.Arc Tangent (atan)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0 :
back1 = true;
break;
case 1 :
cout << "Enter a number (in degrees) you would like to compute the arc tangent of:\n";
cin >> m1 ;
cout << " The arc tangent of " << m1 << " in degrees is " << atan(m1) * 180/ pi << "\n";
break;
}
}while(back1 != true);
break;
case 13:
do
{
cout << "0. Back\n";
cout << "1. atan2\n";
back1 = false;
cin >> index;
switch(index)
{
case 0 :
back1 = true;
break;
case 1:
cout << "Enter the y value of the Arc Tangent 2:\n";
cin >> n1;
cout << "Enter the x value of the Arc Tangent 2:\n";
cin >> z1;
cout << " The Arc Tangent 2 (y,x) is " << atan2(n1,z1) << "\n";
}
}while(back1 != true);
break;
case 14:
do
{
cout << "0. Back\n";
cout << "1. Hyperbolic Sine (sinh)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1:
cout << "Enter a number (in degrees) you would like to compute the hyperbolic sine of\n";
cin >> o1 ;
cout << " The hyperbolic sine of " << o1 << " in degrees is " << sinh(o1) << "\n";
break;
}
}while(back1 != true);
break;
case 15:
do
{
cout << "0. Back\n";
cout << "1. Hyperbolic Cosine (cosh)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1:
cout << "Enter a number (in degrees) you would like to compute the hyperbolic cosine of\n";
cin >> p1 ;
cout << " The hyperbolic cosine of " << p1 << " in degrees is " << cosh(p1) << "\n";
break;
}
}while(back1 != true);
break;
case 16:
do
{
cout << "0. Back\n";
cout << "1. Hyperbolic Tangent (tanh)\n";
back1 = false;
cin >> index;
switch(index)
{
case 0:
back1 = true;
break;
case 1:
cout << "Enter a number (in degrees) you would like to compute the hyperbolic tangent of\n";
cin >> q1 ;
cout << " The hyperbolic oosine of " << q1 << " in degrees is " << tanh(q1) << "\n";
break;
}
}while(back1 != true);
break;
}
}while(quit != true);
system ("pause");
return 0;
}
|