How's it going everybody. Need some help writing a calculator in VB.NET
Right now i have it written so that when a user clicks on a number (ie the number one) it writes it to a text box. no problem.
but what i need to do is be able to store that information into an array that i can iterate through so that i can do the math on the number.
so if a user enters "5" "+" "6" "x" "7" "="
it will store the information into an array as
myarray(5, "plus")
myarray(6, "times")
myarray(7, "equals")
'where the symbol following the number will create the key for 'the number
now i need to iterate it through it like this
if the key = "times" then do somthing like
do current arrayval * next arrayval
store the answer into array as
myarray(45, equals) 'i do this because the key for the 7 was equals, since the times was used in the previous step
now it needs to do this
if current ArrayValKey = "plus"
do
current arrayval + nextarrayval
store the answer to array as
myarray(50, "equals")
then do
if ArrayValKey = equals
then ArrayValKey = answerbox.Text
does anyone have any insight or examples that i may look at??