Question
Visual Basics Chapter 9 Ex 6 In this exercise, you will modify the Warren School application from Chapter 8s Apply the Concepts lesson. Open the
Visual Basics Chapter 9 Ex 6
In this exercise, you will modify the Warren School application from Chapter 8s Apply the Concepts lesson.
Open the Warren Solution.sln file contained in the VB2017\Chap09\Warren Solution folder.
The frmMain_FormClosing procedure should save the sales amounts stored in the intCandy array to a sequential access file named candySales.txt. Code the procedure. The frmMain_Load procedure should fill the array with the sales amounts from the candySales.txt file. (Hint: If the file does not exist, you do not need to display a message to the user.) The frmMain_Load procedure should also display the array amounts in the appropriate label controls. Create an independent Sub procedure named DisplayArray to handle this task. Then, modify the btnAdd_Click procedure so it uses the DisplayArray procedure. Save the solution and then start the application. Type 7 in the Sold box and then click the Add to total button. The number 7 appears in the Choco Bar box. Now, click Kit Kat in the Candy list box, type 10 in the Sold box, and then click the Add to total button. The number 10 appears in the Kit Kat box. Click the Exit button. Open the candySales.txt file. The file contains the numbers 7, 0, 10, 0, and 0. Close the candySales.txt file. Start the application again. The candy boxes on the form reflect the amounts stored in the file: 7, 0, 10, 0, and 0. Click Kit Kat in the Candy box, type 20 in the Sold box, and then click the Add to total button. The number 30 appears in the Kit Kat box. Click the Exit button. Open the candySales.txt file. The file now contains the numbers 7, 0, 30, 0, and 0. Close the candySales.txt file. Start the application again. The candy boxes on the form reflect the amounts stored in the file: 7, 0, 30, 0, and 0. On your own, continue testing the application. When you are finished testing, click the Exit button.
Warren School Chocolate Fund Raiser Chco Cand IstCand Sold Add to total Exit Choco Bar: Choco Bar-Peanuts Kit Kat: Peanut Butter Cup: Take 5 BarStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started