When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
6 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
@red plaza
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
@red plaza
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
#include <iostream>
using namespace std;
void calculator()
{
while (true)
{
string firstNumber;
string secondNumber;
string operatorNumber;
string answer;
cout << "Enter first number: ";
cin >> firstNumber;
cout << "Enter an operator: ";
cin >> operatorNumber;
cout << "Enter second number: ";
cin >> secondNumber;
if (operatorNumber == "+")
{
string answer = firstNumber + secondNumber;
cout << answer;
}
else if (operatorNumber == "-")
{
answer = firstNumber - secondNumber;
}
}
}
int main()
{
string enter_calc;
cout << "Hello there!\nType enter to enter the calculator!" << endl;
cin >> enter_calc;
if (enter_calc == "enter")
{
while (true)
{
cout << "Enter first number: ";
}
}
else if (enter_calc == "Enter")
{
}
}
im lost
!solved