Microsoft Visual Basic 2010 Shelly Cashman Chapter 10 Case Problem 3 Spanish Food Store
Design a Windows application and write the code that will execute according to the program requirements in Figure 10-73 and the Use Case definition in Figure 10-74 on the next page. Before writing the code, create an event planning document for each event in the program. The completed Windows application and other objects in the user interface are shown in Figure 10-75 on the next page. An Access database file named spanishfood.accdb is needed for this application and can be downloaded from scsite.com/vb2010/ch10.
Date submitted: August 1, 2013
Application title: Spanish Food Store Inventory Windows Application
Purpose: This Windows application opens an Access database with 22 food items in the store inventory in a Windows form. The database can be viewed, updated, and deleted. The application also computes the total value of the inventory in stock.
In a Windows application, the Access database file is opened and the user can view, add, and delete records as needed. The total present store value of the Spanish foods in the inventory also can be displayed.
Algorithms, Processing and Conditions:
1. The user first views a Windows application that loads an existing Access database table that includes the product number, English food name, Spanish food name, quantity cost per item, and department. A navigation toolbar appears at the top of the Windows form, allowing the user to move from record to record. The Windows form also includes a title and a graphic image.
2. The user can click the Add new button on the navigation toolbar to add a new food item to the inventory. The record is saved when the user clicks the Save Data button on the navigation toolbar.
3. The user can click the Delete button on the navigation toolbar to delete a food item.The record is permanently deleted when the user clicks the Save Data button on the navigation toolbar.
4. The user can click the Compute Total Value of Inventory Button object to compute the total value of the store’s inventory.
5. The total value of inventory is computed by multiplying the cost per item times the quantity of the item and then adding the result to the value in an accumulator variable.
Notes and Restrictions:
1. The spanishfood.accdb file is located on the USB drive on E: drive.
2. Use a Try-Catch statement to catch an exception if the file is not available.
1. The spanishfood.accdb Access database file can be downloaded from scsite.com/vb2010/ch10.
2. The picture (papers.jpg) is available for download at scsite.com/vb2010/ch10images.
USE CASE DEFINITION
1. The use views the Access database information displaying the Spanish food inventory items.
2. The user clicks the Add new button to add a new food item and clicks the Save Data button to save the item to the original database.
3. The user clicks the Delete button to delete a Spanish food item and permanently deletes the record from the original database by clicking the Save Data button.
4. The user clicks the Compute Total Value of Inventory button to display the total value of inventory in the database.