Question: Research the Visual Basic ReDim statement. What is the purpose of the statement? What is the purpose of the Preserve keyword? a. Open the ReDim

Research the Visual Basic ReDim statement. What is the purpose of the statement? What is the purpose of the Preserve keyword?
a. Open the ReDim Solution.sln contained in the VB2017\Chap08\ReDim Solution folder. Open the Code Editor window and locate the array declaration statement in the form class’s declarations section. Start the application. Type 25 in the Sales box and then click the Add to array button. An error message box opens and informs you that the computer encountered an error when trying to process the TryParse method in the btnAdd_Click procedure. Stop the application.

b. Modify the btnAdd_Click procedure so that it can store any number of sales amounts in the array. (Hint: Use the ReDim statement to add an element to the array before the TryParse method is processed.) 

c. Save the solution and then start the application. Type 25 in the Sales box and then press Enter. Click the Display array button . The sales amount appears in the list box. 

d. Now, use the Add to array button to add the following sales amounts, one at a time: 700, 550, and 800. Click the Display array button. The four sales amounts appear in the list box.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Microsoft Visual Studio Solution File Format Version 1200 Visual Studio 15 VisualStudioVe... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Microsoft Visual Basic Questions!