#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; string display_text = ""; // Simulate user pressing buttons: 1, 2, 3, +, 4, 5, 6 display_text = display_text + "123"; cout << "Display: " << display_text << endl; display_text = display_text + "+"; cout << "Display: " << display_text << endl; display_text = display_text + "456"; cout << "Display: " << display_text << endl; // Simulate pressing '='. This is where uCalc does the work. auto result = uc.EvalStr(display_text); display_text = result; cout << "Result: " << display_text << endl; cout << "" << endl; // Simulate a new calculation with an error display_text = "5 * / 3"; cout << "Display: " << display_text << endl; result = uc.EvalStr(display_text); display_text = result; cout << "Result: " << display_text << endl; cout << "" << endl; // Simulate clearing the display display_text = "C"; // Let's say 'C' is a special command if (display_text == "C") { display_text = ""; } cout << "Display after clear: '" << display_text << "'" << endl; }