code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
Terms of Agreement:
By using this code, you agree to the following terms...
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
//
#include
#include
#include
void main()
{
int asmd;
float add1;
float add2;
float subtract1;
float subtract2;
float multiply1;
float multiply2;
float divide1;
float divide2;
float x;
float dia;
float quad1;
float quad2;
float ang1;
float ang2;
float adj;
float opp;
float celsius;
int quit;
cout << " do you want to..." << endl;
cout << "1) Add" << endl;
cout << " 2) Subtract" << endl;
cout << " 3) Multiply" << endl;
cout << "4) Divide" << endl;
cout << "5) Find the square root of a number" << endl;
cout << " 6) Find out the circumference of a circle" << endl;
cout << " 7) Find out the area of a quadralateral" << endl;
cout << "8) Find out what an angle of a triangle is" << endl;
cout << "9) Solve for the hypontinus of a right angle (Pythagoreams Theorum)" << endl;
cout << " 10) Convert from Farenheit to Celsius" << endl;
cin >> asmd;
{
if (asmd==1)
{
cout << "Enter the first number" << endl;
cin >> add1;
cout << "Enter the second number" << endl;
cin >> add2;
cout << "Your answer is: " << add1+add2 << endl;
}
else if(asmd==2)
{
cout << "Enter the first number" << endl;
cin >> subtract1;
cout << "Enter the second number" << endl;
cin >> subtract2;
cout << "Your answer is: " << subtract1-subtract2 << endl;
}
else if(asmd==3)
{
cout << "Enter the first number" << endl;
cin >> multiply1;
cout << "Enter the second number" << endl;
cin >> multiply2;
cout << "Your answer is: " << multiply1*multiply2 << endl;
}
else if(asmd==4)
{
cout << "Enter the dividend" << endl;
cin >> divide1;
cout << "Enter the divisor" << endl;
cin >> divide2;
cout << "Your answer is: " << divide1/divide2 << endl;
}
else if(asmd==5)
{
cout << "Enter a number" << endl;
cin >> x;
cout << "Your answer is: " << sqrt(x) << endl;
}
else if(asmd==6)
{
cout << "Enter the diameter of the circle" << endl;
cin >> dia;
cout << "Your answer is: " << dia*3.14 << endl;
}
else if(asmd==7)
{
cout << "Enter the length of the quadrilateral" << endl;
cin >> quad1;
cout << "Enter the width of the quadrilateral" << endl;
cin >> quad2;
cout << "Your answer is: " << quad1*quad2 << endl;
}
else if(asmd==8)
{
cout << "Enter the 1st angle" << endl;
cin >> ang1;
cout << "Enter the 2nd angle" << endl;
cin >> ang2;
cout << "Your answer is: " << 180-(ang1+ang2) << endl;
}
else if(asmd==9)
{
cout << "Enter the value of the adjectant side" << endl;
cin >> adj;
cout << "Enter the value of the opposite side" << endl;
cin >> opp;
cout << "Your answer is: " << sqrt((adj*adj)+(opp*opp) )<< endl;
}
}