This lab will give you practice processing 2-Dimensional arrays. You will also use the skills you learned related to ComboBox controls.

Exercise

During this exercise you will develop an app that could be used by FooBar Grocery Store to summarize sales by department and by day. The user interacts with the app by selecting a department and then entering the 5 daily sales for that department. The user clicks an Add Item Button to add a department's daily sales to a list of daily sales organized by department. Here are some images to help you understand how your GUI should behave:

When your GUI first loads it should look like this: see image.

The large display area is a ListBox control that displays the 3-character abbreviations for weekdays. The user starts using the app by picking a department from the ComboBox control. For example, the user first picks the Deli department: see image.

The user then enters the sales data for each of the 5 weekdays for the Deli department: see image.

When the user is satisfied that the daily sales are entered correctly, the user clicks the Add Item Button: see image.

The user's data is listed in the ListBox output area and the input TextBoxes are cleared so that they are ready for the next department's data with the cursor sitting on the Monday TextBox.

The user can then enter data for another department such as Floral: see image.

When the user is satisfied the data is correct she clicks the Add Item Button: see image.

Again, the user's data is added in the ListBox output area and the input TextBoxes are cleared so they are ready for the next department's data with the cursor sitting on the Monday TextBox.

The user can continue to add data for different departments such as Dairy, Produce, Frozen and Seafood. After the user clicks the Add Item Button for the 6th department in this example, the app would look like this: see image.

Again, the user's data is added in the ListBox output area and the input TextBoxes are cleared so they are ready for the next department's data.

If the user is done entering sales data for departments, the user can click the Display Subtotals Button: see image.

Notice that the daily subtotals are listed below the day columns and the department weekly sales subtotals are listed in the Totals column. Also, the Total output Label shows the sum of all sales.

At this point, because the Add Item Button is disabled, the user's only other possible action is to click the Clear Data Button, which will clear all of the data from the GUI and underlying arrays (except the department names data from the ComboBox). The GUI and app should return to its loading state: see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.