Question: Need help with Visual Basic 2012 C++ problem. Need to make fork that user types state name into text box and the state flower is
#2 (35 pts.) This program uses two parallel arrays to store information about state flowers. Text file states.txt available on First Class contains state names followed by state flowers. Create two arrays of strings where the first stores state names and the second stores state flowers as read from the text file. The arrays should be filled in the Form Load event. Sort the arrays by the state name using the bubble sort algorithm studied in lecture. Hint: Be sure the flower stays with its state so when you swap states, swap their flowers also as practiced in lab. Model of these parallel arrays: states 0 Alabama 1 Alaska flowers 0 Camellia 1 | Forget Me Not 2 S 2 Arizona 3Arkansas Saguaro Cactus 3Apple Blossom Design a form in which the user enters a state name in a Text Box and clicks a button to see the state flower in a label. If the state cannot be found display an error message in the label instead. This program should call the binary search Function since the data is sorted by state. The binary search program s Function is passed an array of strings and a target string. It returns the index of the target if found or -1 if not found. It is the same algorithm studied in lecture, you need to adjust it to search an array of strings. Print the code and two sample outputs, one of the state flower for Maine and one showing an error from a misspelled state name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
