Mohahaha, I was bored so i played around with C++, and made this little calculator. (Btw Snoozer = Me)
It contains
-Add
-Subtract
-Divide
-Multiply
-Square root
-Exponentiation
Any suggestions?
-Post em plox so i can improve this lil thing ;D!
Download here: http://easy-upload.nl/f/d1iyuyBe
For anyone who's interested, here's the source code~
It contains
-Add
-Subtract
-Divide
-Multiply
-Square root
-Exponentiation
Any suggestions?
-Post em plox so i can improve this lil thing ;D!
Download here: http://easy-upload.nl/f/d1iyuyBe
For anyone who's interested, here's the source code~
- Code:
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
float a;
float b;
float s;
string choice;
string cont;
string zchoice;
cout << "\nHello peoplez.\nMy name is Snoozer's Calculator V1.2\n";
cout << "So, How can i help you today?\n\nType \"A\" for Add.";
cout << "\nType \"S\" for Subtract.\nType \"M\" for Multiply\n";
cout << "Type \"D\" for Divide\nType \"R\" for Square Root\nType \"E\" for Exponentiation\n";
cin >> choice;
if (choice == "A")
{
cout << "\nYou chose Add, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the first number:\n";
cin >> a;
cout << "Now type the second number:\n";
cin >> b;
cout << " " << a << " + " << b << " = " << a+b << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
if (choice == "S")
{
cout << "\nYou chose Subtract, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the first number:\n";
cin >> a;
cout << "Now type the second number:\n";
cin >> b;
cout << " " << a << " - " << b << " = " << a-b << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
if (choice == "M")
{
cout << "\nYou chose Multiply, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the first number:\n";
cin >> a;
cout << "Now type the second number:\n";
cin >> b;
cout << " " << a << " * " << b << " = " << a*b << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
if (choice == "D")
{
cout << "\nYou chose Divine, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the first number:\n";
cin >> a;
cout << "Now type the second number:\n";
cin >> b;
cout << " " << a << " / " << b << " = " << a/b << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
if (choice == "R")
{
cout << "\nYou chose Square root, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the number:\n";
cin >> a;
cout << "Ther square root out " << a << " Is " << sqrt(a) << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
if (choice == "E")
{
cout << "\nYou chose Exponentiation, is this correct? Type: Yes/No\n";
cin >> zchoice;
if (zchoice == "No")
{
main ();
}
else (zchoice == "Yes");
{
cout << "\nOk good!\nPlease type in the number:\n";
cin >> a;
cout << "Now type the Exponent:\n";
cin >> b;
cout << " " << a << " ^ " << b << " = " << pow(a, b) << endl;
cout << "\n";
cout << "Would you like to continue? Type: Yes/No\n";
cin >> cont;
if (cont == "Yes")
{
main ();
}
else (cont == "No");
{
return 0;
}
}
}
char f;
cin >> f;
return 0;
}