Question: Hello, I need help solving an issue with some of my code for a lab assignment. I have almost all of it finished. I will
Hello, I need help solving an issue with some of my code for a lab assignment. I have almost all of it finished. I will include details of the assignment and my code snippet below. I made a calculator using wxWidgets in c++, I have implemented simple calculations and its working. However, I am trying to implement Sine, cosine, and tangent. It seems that the program isn't hitting that part of the switch case, I've put breakpoints in for the other operators and stepped through and the others work fine. I have a few theories as to why this is happening, but I don't know the exact cause.
Specifically, I think the problem is in the CalculateResult function. I was trying to implement sin correctly before moving on to the others. Its not getting any type of value and returning 0. I included the header and cpp files below.


every button. Do not use bind for this lab. Button Functionality 1. When the following buttons are pressed, their button label or corresponding symbol will be added to the text control. a. Numbers 0-9 b. Binary Operation Buttons(+, -, *, /, %) c. Decimal Button d. Negative Button e. Unary Operation Buttons (Sin, Cos, Tan) 2. Clear Button a. The clear button should fully clear the text box and the backspace button should remove the last character in the textbox. The backspace button should repeat this behavior until there's nothing left in the textbox. 3. Backspace/Delete Button a. The backspace button should delete the last character in the text control. Repeatedly pressing the backspace button should continue deleting each character until the text control is empty. The program should not crash if the text control is empty. 4. Equals Button a. The = button will attempt to calculate whatever string is contained within the text control, clear it, and display the result in the text control. b. The program should not crash if the text box is empty or if the text control contains an invalid expression.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
