8 January 2012, 1:10 am
Here is the question. Write a program that requests a state and category (flower, motto and nickname) as input and displays the requested information. If the state or category requested is not in the table, the program should so inform the user. Table 4.7 State, Flower, Nickname, and Motto State Flower Nickname Motto California Golden Poppy Golden State Eureka Indiana Peony Hoosier State Crossroads of America Mississippi Magnolia Magnolia State By valor of arms New York Rose Empire State Ever upward My problem is the input1 and input2 say they cannot be converted to string and I dont know what i am doing wrong they are textboxes so i know i did something wrong but i cant figure it out here is what i have written. Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click 'Display state and category Dim state As String Dim category As String state = input1 category = input2 Select Case state.ToUpper Case "CALIFORNIA" Select Case category.ToUpper Case "FLOWER" output.Text = "Gold Poppy" Case "NICKNAME" output.Text = "Golden State" Case "MOTTO" output.Text = "Eureka" End Select End Select Select Case state.ToUpper Case "Indiana" Select Case category.ToUpper Case ("FLOWER") output.Text = "Peony" Case ("NICKNAME") output.Text = "Hoosier State" Case ("MOTTO") output.Text = "Crossroads to America" End Select End Select Select Case state.ToUpper Case "MISSISSIPPI" Select Case category.ToUpper Case "FLOWER" output.Text = "Magnolia" Case "NICKNAME" output.Text = "Magnolia State" Case "MOTTO" output.Text = "By valor and arms" End Select End Select Select Case state.ToUpper Case "NEW YORK" Select Case category.ToUpper Case "FLOWER" output.Text = "Rose" Case "NICKNAME" output.Text = "Empire State" Case "MOTTO" output.Text = "Ever Upward" End Select End Select... Read More »