Email
 Submitted on: 1/5/2015 7:16:00 AM By: Kevin Huang (from psc cd) Level: Beginner User Rating: By 3 Users Compatibility: C++ (general) Views: 734

Just a little calculator, might be helpful in the function department.

### INCLUDE files:

Can't Copy and Paste this?
 ```//************************************** //INCLUDE files for :Riotblade's Simple Calculator //************************************** ```
code:
Can't Copy and Paste this?
 ``` //************************************** // Name: Riotblade's Simple Calculator // Description:Just a little calculator, might be helpful in the function department. // By: Kevin Huang (from psc cd) // // Assumes:Contains some area formulas just for helping you out. //************************************** #include #include using namespace std; int main(int argc, char *argv[]) { int choices; long int a,b,c; std::cout << "Hi, welcome to Riotblade's calculator.\n"; std::cout << "Select what you want to do.\n"; std::cout << "(1)\tAdd\n"; std::cout << "(2)\tSubtract\n"; std::cout << "(3)\tDivide\n"; std::cout << "(4)\tMultiply\n"; std::cout << "(5)\tFormulas\n"; std::cout << "(6)\tQuit\n"; std::cin >> choices; switch (choices) { case 1: std::cout << "Enter two numbers.\n"; std::cin >> a; std::cin >> b; c=(a+b); std::cout << "Your answer is " << c << ".\n"; break; case 2: std::cout << "Enter two numbers.\n"; std::cin >> a; std::cin >> b; c=(a-b); std::cout << "Your answer is " << c << ".\n"; break; case 3: std::std::cout << "Enter two numbers.\n"; std::cin >> a; std::cin >> b; c=(a/b); std::cout << "Your answer is " << c << ".\n"; break; case 4: std::cout << "Enter two numbers.\n"; std::cin >> a; std::cin >> b; c=(a*b); std::cout << "Your answer is " << c << ".\n"; break; case 5: std::cout << "Area Formulas\n"; std::cout << "Square: a*a\n"; std::cout << "Rectangle: a*b\n"; std::cout << "Parallelogram: base*height\n"; std::cout << "Trapezoid: Height/2(b1+b2)\n"; std::cout << "Circle: Pi*Radius squared\n"; std::cout << "Ellipse: pi*r1*r2\n"; std::cout << "Triagle: 1/2*b*h\n"; std::cout << "Equillateral Triangle: Squareroot of 3/4 * (a squared)\n"; break; case 6: abort(); break; } system("PAUSE"); return 0; }```

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)