Question: Hint: This problem is not hard, but can be time consuming since many conditions. Prompt the user to enter a sequence of numbers and arithmetic

Hint: This problem is not hard, but can be time consuming since many conditions. Prompt the user to enter a sequence of numbers and arithmetic symbols as words, and then calculate the result of the equation.

  • Valid number words: zero, one, two, three, four, five, six, seven, eight, nine

  • Valid symbol words: plus, minus, times, divides

  • Order of operation is simply left to right. That is, calculate immediately after reading two numbers and one arithmetic symbol.

  • Use the std::to_string function to convert an int to a string. E.g.,

    • string numberText = std::to_string(9); // string numberText = "9";

Hint: This problem is not hard, but can be time consuming since

In c++

Prompt the user to enter a sequence of numbers and arithmetic symbols as words, and then calculate the result of the equation. . Valid number words: zero, one, two, three, four, five, six, seven, eight, nine Valid symbol words: plus, minus, times, divides Order of operation is simply left to right. That is, calculate immediately after reading two numbers and one arithmetic symbol. Use the std::to_string function to convert an int to a string. E.g., o string numberText = std::to_string(9); // string numberText = "9"; Sample Execution Please enter word equation (type 'equals' at the end) : five times two plus four divides seven equals 5 * 2 + 4 / 7 = 2 I Full Screen calculator.cpp + New 1 #include 2 #include 3 using std::cin, std::cout, std::endl, std::string, std::to_string; 4. 5- int main() { 6 7 8 return 0; 9} 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!