#include <iostream>
#include <string>
#include <Equals>
usingnamespace std;
int main(){
int a;
int b;
string modus;
int sum;
cout << "Welcome to the amazing calculator,\n";
cout << "Please enter your first number: ";
cin >> a;
cout << "Now enter your second number:";
cin >> b;
cout << "Type 1 to extract \n";
cout << "Type 2 to divide \n";
cout << "Type 3 to make a sum \n";
cout << "Type 4 to multiply them";
cin >> modus;
if(modus.Equals('1'))
{
sum = a - b;
}elseif(modus.Equals('2'))
{
sum = a / b;
}elseif(modus.Equals('3'))
{
sum = a + b;
}elseif(modus.Equals('4'))
{
sum = a * b;
}else {return 0;}
cout << "Your answer is: " <<sum;
return 0;
}
No, Equals is not a member of std::string. You can use operator== to compare a string with another string. if(modus == "1") Note that double quotes are used for strings. Single quotes is used for characters.