Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Galaxy Trekkers Figure 1 In this case, you will create a Visual Basic solution that displays the Galaxy Trekkers club membership. This program uses an

image text in transcribed

Galaxy Trekkers Figure 1 In this case, you will create a Visual Basic solution that displays the Galaxy Trekkers club membership. This program uses an array of structures to hold membership information that is read in from a sequential tile. You will use a graphic file and a text data file with the instructions below Step 1: Create the Project: Create a Visual Basic Project using the project name "GalaxyTrekkers Step 2 - Design the Form: Design the form as shown in Figure 1. You will need one button control, one list box, and ane picture box. Load the downloaded galaxy.jpg image into the picture box Step 3- Add the text file to the project: Copy the downloaded text file to the GalaxyTrekkers folder using Windows Explorer, In the VB.Net IDE, click on the Project menu and select Add existing item. Browse to the GalaxyTrekkers folder. In the File Type combo at the bottom of the Add Existing dialog, select All Files. You wil now see the downloaded file StudentList.bt Select it and click on Add. The text file will now appear in the Solution Explorer. By doing this, you are now able to view the contents of the file within the IDE by double-clicking its name in Solution Explorer Look at the fe contents. You will see that there are 6 fields for each record, separated by commas. The fields are ID, last name, first name, middie initial, grade, and class period. These fields will need to be declared as member variables in a structure. Treat all of these fields as type String. Step 4 Declare the form-level variables Declare a structure named Members that contains a member variable or each of the fields in the text file Declare an array of type Member with a size af 250 Step 5-Write a procedure to read the text file and load the list box: Chapter 11 presented introduction (split function) that read the entire contents of a text file into memory and then parsed out each record by searching for the occurrence of a delimiter. In this program, you will do that, but after reading in one line of the text file, you must also break out the individual fields For each line in the text tiecreate a new structure ot type Member, and load the individual member variables at the structure with the values trom the text file line. Then add that structure to the next available position in the array of structures. When the entire file has been read in and loaded into structures in the array, then load the list box by reading the array. Only the ID, last name and first name fiekis will be loaded into the list box. See Figure 2 for details of how the list box contents should appear Hints 1-Use a For loop to break out the tields in each line of the text tile, because you know how many fields there 2- You will have to pad the ID field to a length of 10 to make the dsplay in the ist box look right Step 6- Add code in the Form's Load event: Call the procedure created in Siep 5 to load the data into the structure array and display the members in the list box. Step 7 Finish up: Be sure to add the code for the Exit button Step 8: Save and run Save all files, then start the application. Figure 2 shows a sample run of this program. Galaxy Trekkers 000000007 Bond James 000001111 Acern Joge 001113311 Adast, John Q 000111441 Adst, Che 001144999 bb Abbolt, Jam 000121212Aodbride, Arthony 000001221 Figure 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions