/* C++ Calculator made
by Hyperion */
#include <iostream>
using namespace std;
int main ()
{
cout << "This calculator was programmed by Hyperion with c++.";
cout << "\nPlease do not redistribute the program without the authorized";
cout << "\nconsent of the programmer!";
int a, j;
double b, c, d, e, f, g, h, i, k, l, m, n, o, p, q;
cout << "\nWelcome!!!\n";
do
{
cout << "\nWould you like basic arithmetic calculator or geometry calculator?\n";
cout << "\n(Basic Arithmetic = 1 | Geometry = 5):";
cin >> a;
if (a == 1)
{
cout << "\nWould you like to add, subtract, multiply, or divide?";
cout << "\n(Add = 1 | Subtract = 2 | Multiply = 3 | Divide = 4):";
cin >> a;
if (a == 1)
{
cout << "Addition it is. Please enter your first number:";
cin >> b;
cout << "\nPlease enter a number to add with:";
cin >> c;
cout << "\nYour number is\n";
cout << b + c;
}
if (a == 2)
{
cout << "Subtraction it is. Please enter a number:";
cin >> d;
cout << "Please enter a number to subtract with:";
cin >> e;
cout << "\nYour number is\n";
cout << d - e;
}
if (a == 3)
{
cout << "Multiply it is. Please enter a number:";
cin >> f;
cout << "\nPlease enter a number to multiply with:\n";
cin >> g;
cout << "Your number is\n";
cout << f * g;
}
if (a == 4)
{
cout << "Divide it is. Please enter a number:";
cin >>h;
cout << "Please enter a number to divide with:";
cin >> i;
cout << "\nYour number is\n";
cout << h / i;
}
if (a > 4)
{
cout << "Program error!!!";
}
if (a < 1)
{
cout << "Program error!!!";
}
cout << "\nThanks for using the C++ Calculator!\n";
}
if (a == 5)
{
double r, s, t, u;
cout << "\nWhat shape are you trying to find the area/volume of?\n";
cout << "(Square = 1 | Triangle = 2 | Circle = 3 | Rectangle = 4 | Sphere = 5):";
cin >> j;
if (j == 1)
{
cout << "\nPlease enter the side length of the square:";
cin >> k;
cout << "\nThe area of the sqare is\n";
cout << k * k;
}
if (j == 2)
{
cout << "\nPlease enter the base of the triangle:";
cin >> l;
cout << "\nPlease enter the height of the triangle:";
cin >> m;
n = l * m * .5;
cout << "\nThe area of the triangle is\n";
cout << n;
}
if (j == 3)
{
cout << "\nPlease enter the radius of the circle:";
cin >> o;
p = o * o;
q = p * 3.14;
cout << "\nThe area of the circle is\n";
cout << q;
}
if (j == 4)
{
cout << "\nPlease enter the the width of the rectangle:";
cin >> r;
cout << "\nPlease enter the length of the rectange:";
cin >> s;
cout << "\nThe area if the rectangle is\n";
cout << r * s;
}
if (j == 5)
{
cout << "\nPlease enter the radius of the sphere:";
cin >> t;
u = 1.33333333 * 3.14 * t * t * t;
cout << "\nThe voluma of the sphere is\n";
cout << u;
}
cout << "\nThanks for using the C++ Calculator!";
}
} while (a != 0);
return 0;
}