#include <iostream> //Basic input output for interaction with user
#include <Windows.h> //Might need for Sleep function
#include <conio.h>
#include <string> //Operator
#include <cstdlib>
usingnamespace std; //No need to explain...
int Main()
{
int num1 = 0, num2 = 0, Continue = 1;
string Operator;
while(Continue == 1)
{
cout << "Hello, and thank you for choosing Awesome Calculator v1.0" << endl;
cout << "Please enter an operation such as +, -, /, or *" << endl << endl;
getline(cin, Operator);
while (Operator != "+" && Operator != "-" && Operator != "/" && Operator != "*")
{
cout << "That is not a mathematical operator, please enter a proper mathematical operator: " << endl;
getline (cin, Operator);
}
if(Operator == "+")
{
cout << "Please enter the first number to add: " << endl;
cin >> num1;
cout << "Please enter the second number to add: " << endl << endl << endl;
cin >> num2;
cout << "Calculating";
cout << "25%";
Sleep(500);
cout << "50%";
Sleep(500);
cout << "75%";
Sleep(500);
cout << "100%";
cout << "The result for " << num1 << " + " << num2 << " = " << num1 + num2;
}
elseif(Operator == "-")
{
cout << "Please enter the first number to subtract: " << endl;
cin >> num1;
cout << "Please enter the second number to subtract: " << endl << endl << endl;
cin >> num2;
cout << "Calculating";
cout << "25%";
Sleep(500);
cout << "50%";
Sleep(500);
cout << "75%";
Sleep(500);
cout << "100%";
cout << "The result for " << num1 << " - " << num2 << " = " << num1 - num2;
}
elseif(Operator == "/")
{
cout << "Please enter the first number to divide: " << endl;
cin >> num1;
cout << "Please enter the second number to divide: " << endl << endl << endl;
cin >> num2;
cout << "Calculating";
cout << "25%";
Sleep(500);
cout << "50%";
Sleep(500);
cout << "75%";
Sleep(500);
cout << "100%";
cout << "The result for " << num1 << " / " << num2 << " = " << num1 / num2;
}
elseif(Operator == "*")
{
cout << "Please enter the first number to multiply: " << endl;
cin >> num1;
cout << "Please enter the second number to multiply: " << endl << endl << endl;
cin >> num2;
cout << "Calculating";
cout << "25%";
Sleep(500);
cout << "50%";
Sleep(500);
cout << "75%";
Sleep(500);
cout << "100%";
cout << "The result for " << num1 << " * " << num2 << " = " << num1 * num2;
}
}
return 0;
}
Error 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C:\Users\Raka Gunarto\Documents\Visual Studio 2012\Calculator\Calculator\MSVCRTD.lib(crtexe.obj) Calculator