Monday, February 10, 2014

Section 3.3 Input and Output: Input and Output




41011:  Assume that name has been declared suitably for storing names (like "Amy", "Fritz" and "Moustafa")  Write some code that areads a value from a text box named textBox into name then prints the message "Greetings, NAME!!!" where NAME is replaced the value that was read into name.  For example, if your code read in "Hassan" it would print out "Greetings, Hassan!!!".

name = textBox.Text
MessageBox.Show("Greetings, " & name & "!!!")

41010:  Assume you have a text box named textBox.  Write some code that inputs the value in the text box into a variable name and then outputs "Greetings, NAME" to a message box (where NAME is replace by the value that was input read in the variable.  For example, if the text box originally contained "Rachel" your code would display "Greetings, Rachel" in the message box.

name = textBox.Text
MessageBox.Show("Greetings, " & name)

1 comment: