doing stuff with numbers!

172 2 0
                                        

This is a new program. Simply create a new program and put 3 textboxs and a button. Preferable put the text boxes all in a row. This is not the quickest or easiest way but it does show a point. Double click the first text box.and type:

Dim number1 as integer

Textbox.text=number1

Double click the second text box and type:

Dim symble as string

textbox.text=symble

Double click the third text box and type

Dim number2 as integer

textbox.text=number2

FYI:

you just made three text boxes. the first one has a number. the second one has a symble of what you want to do with the number(add subtract divide or multiply) and the third one has the second number. but there is still more to do

Now double click the button and type

if symbol = "+" then

messagebox( number1 + number2 )

Elseif symbol = "-" Then

messagebox( number1 - number2 )

Elseif symbol = "÷" then

Messagebox( number1 ÷ number2)

Else

Messagebox( number1 × number2)

Press f5 and try it. Enter your numbers and symble. It is important to know that in the symbal text box anything other than +÷- will multiply the numbers. If u begin receiving errors make sure that u are entering the numbers in the right text box.

Fyi

u just made your program check to see if it is addition, if it is then the then statement is executed. If it isn't then It begins checking all of the other stuff just like it did with the addition.

Finaly it does the math and displays the answer.

You have just finished this lesson. Please tell me if there are any errors.

You've reached the end of published parts.

⏰ Last updated: Aug 21, 2012 ⏰

Add this story to your Library to get notified about new parts!

basic programming tutorialWhere stories live. Discover now