//The Calculator
#include <iostream>
#include <string>
#include <sstream>
usingnamespace std;
int addition(float a, int b)
{
float result;
result = a+b;
return result;
}
int multiplication(float a, float b)
{
float result;
result = a*b;
return result;
}
int division(float a, float b)
{
float result;
result = a/b;
return result;
}
int subtraction(int a, int b)
{
int result;
result = a-b;
return result;
}
int remainder(float a, float b)
{
float result;
result = a*b;
return result;
}
int main()
{
cout << "Which operation do you want to calculate? There is addition, subtraction, multiplication, division and remainder.";
string operation;
getline(cin,operation);
if (operation == addition)
cout << "You chosen addition.";
elseif (operation == subtraction)
cout << "You chosen subtraction";
elseif (operation == multiplication)
cout << "You chosen multiplication.";
elseif (operation == division)
cout << "You chosen division.";
elseif (operation == remainder)
cout << "You chosen to find the remainder.";
else
cout << "You typed something else. Terminating program...";
return 0;
}
I even tried using type instead of operation. It pops up with this error message: no match for'operator==' in 'operation == addition'
What is wrong with this code and what can I do to fix it?