I’m having a hard time to make a simple calculator for my school project. Can someone help me or give me an idea how to do it?
I’m afraid you’ll have to be more specific. What kind of calculator? How should it work? Step-by-step like photomath? As a sort of equation solver? Or just a simple, windows calculator-like one?
like an simple window calculator sir
What I would do is use three variables. One to store the first number, one to store the action(/,*,+,-), and one to store the other number.
So, you’d have the 10 number buttons, and have an event say “on click, add the number I clicked on to the string”. It has to be a string variable. Then, after I clicked on one of the actions, I’d have it switch to the second number variable and do the same thing.
Then (when the = button is pressed) make a fourth variable, call it result, and make it equal to "ToNumber(num1) (whatever operation you need to do) ToNumber(num2) "
Then you can use a text object to display the ToString(result).
This is probably as far as I’ll go without making the whole thing myself.
thankyou so much for the idea sir that will help me thanks!!
Thank you for your nice comments. However I am a beginner in this field.
Could you kindly make a simple video and upload it to YouTube.
Many many thanks in advance.