P a g e | 1 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca ISTM133P: Lesson 9 Assignment Creating Lists / Program Organization – Girl Scout Cookie Program Background: The purpose of this...

I need help building this program, we are studying 2d lists and need help


P a g e | 1 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca ISTM133P: Lesson 9 Assignment Creating Lists / Program Organization – Girl Scout Cookie Program Background: The purpose of this advanced/intermediate assignment is to demonstrate 2-Dimensional List functionality, and to organize the program to take advantage of functions and Pythons natural scripting ability. In this program, you will redesign the GSC program, which was part of your in-lesson work, based upon the structural changes identified in Lesson 8. Your will thoroughly test and submit this program for your assignment. Your redesign will create a number of new functions, and add 2-dimensional lists capability. Note: As usual, this program can be solved in several ways. As this assignment is designed to allow the student to demonstrate a specific set of outcomes, your solution should follow these guidelines. Expansion is allowed. If you include new or unusual techniques, be sure to identify these in the code AND in the message box in Blackboard. Instructions: Main Program Design your main program as follows: # Primary loop choice = "" # seeding value while choice.lower() != "q": #while True: choice = disp_menu() if choice == "a": add_process() elif choice == "d": delete_process() elif choice != "q": disp_order() Lists There should be five lists for this program. • order_list – this is the 2D list for controlling the order collection • menu_list – this list contains the processing selection options and is displayed in disp_menu() • flavor_list – this list contains the names of the cookie flavors available for purchase. Flavors will be: o Savanahs, Thin-Mints, Tag-a-longs, Do-Si-Dos, PeanutButter (spelling is critical) • up_charge_list – this list contains the names of cookies which sell at $5.00 per box. All other flavors sell at $3.50 per box. Flavors will be o Tag-a-longs, PeanutButter, LemonDos P a g e | 2 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca • detail_list – this is the 1D list containing the item selection and is input for the order_list. Fields in this list will be o choice – the cookie flavor identified by it’s index in the flavor_list o qty – the quantity of boxes ordered o price – the price per box for this flavor Major Functions Create functions using the following guidelines: disp_menu() This function displays user options (a = add, d = delete, o = display order, q = quit). Invalid data entry will result in an error message and request to re-enter. Valid data entry will be returned to the call. disp_flavors() This function displays the cookie flavors available for selection. No data is passed to or returned from this function. disp_order() This is a no data in / no data out function which will display all items in the order; and will determine the total number of boxes in the order, and the total price of the order. If there are no items in the meal to display, the program will generate an error message to that effect. add_process() This function controls item data entry and will call at least the following sub-functions: input_flavor() [subfunction of add_process] This function controls the valid data entry of the flavor. The list of flavors is displayed in disp_flavors(). Each flavor is identified by an item number which is the list index + 1. Input must be an integer and must be one of the numbers available in the list display. On valid entry, the choice value is returned to add_process. On invalid entry, respond with an appropriate message and request re-entry. input_qty() [subfunction of add_process] This function determines the number of boxes ordered per item. Input must be an integer and must be between 1 and 10. On valid entry, the quantity value is returned to add_process. On invalid entry, respond with an appropriate message and request re-entry. determine_price(choice) [subfunction of add_process] This function controls the application of an appropriate price for the flavor selected. The item choice is passed to this function. Using the choice as an index, determine the cookie flavor. Then, access the flavor against the flavors in the up_charge_list. If found, return 5.0. If not found, return 3.5. verify_item(choice, qty, price) [subfunction of add_process] This function prepares a verification message to the user indicating the imminent addition of a new order item. If the user responds in the affirmative, pass the order data to add_to_order() for processing. If the user responds in the negative, do not add the item to the order. P a g e | 3 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca add_to_order(choice,qty,price) [subfunction of verify_item()] This function controls adding the item name and corresponding calories to the order_lists. There are multiple solutions here. It is recommended that you create a detail_list with three values correlating to choice, quantity, and price; and then append the detail_list to the order_list. delete_process() This process controls delete requests. If there are no items in the order_list, respond with an appropriate error message. Otherwise, re-display the order, call input_selection() and verify_delete(). If the user responds in the affirmative, delete the order item. If the user responds in the negative, do not delete the order item. input_selection() [subfunction of delete_process()] This function prompts the user to identify the item to be deleted by item number. Item number must be integer and must be a value available in the order. Invalid data should display an appropriate error message. Valid data is returned to delete_process. verify_delete(choice) [subfunction of delete_process()] This function prompts the user to verify the delete request. If the user responds in the affirmative, return a Boolean True. If the user responds in the negative, return a Boolean False. Invalid data should display an appropriate error message. Data validation: In the add process, the following data validation must occur. Invalid data should display an appropriate error message. The program must not fail due to bad data entry. • Flavor choices must exist. • All integer inputs must be integers • When choices of y or n are required, any other entry shall flag an error. In the delete process, the following data validation must occur. • If there are no items in the order, display an appropriate message and do not display the order list • Delete choice must be a valid integer • Delete choice must exist on the list. Do not allow the user to choose an item which does not exist. Upon valid data, verify the user’s intent with an “Are you sure…?” message. Valid entries are “y” or “n”. With an “n” entry, respond with an appropriate message such as “Item [name] was not deleted…”. With an “y” entry, execute the delete action and respond with an appropriate message such as “Item [name] was deleted…”, and then either display the current meal, or, if the meal is empty, an appropriate message. Hint: Consider creating a unique error id for each error message. This will assist you in verifying that all error message are encountered. Example: Error 101: that option was not recognized P a g e | 4 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca Output While actual output solutions may vary, here is a sample output for the addition of a second item into the order: Please choose an option>a ------------------------------ Here are our cookies: 1. Savanahs 2. Thin-Mints 3. Tag-a-longs 4. Do-Si-Dos 5. PeanutButter ------------------------------ Please choose a flavor by number>5 How many would you like? (1-10)>5 You selected 5 box(es) of PeanutButter for $5.00 Would you like to add this to your order? (y/n)>y Program Options a - (a)dd cookie d - (d)elete cookie o - display the (o)rder q - (q)uit Please choose an option>o Here is your order so far... itm Flavor Qty Item Price 1. Savanahs 1 $3.50 2. PeanutButter 5 $5.00 ------------------------------ Total 6 $8.50 Testing This lab requires a complete redesign of your lab. For credit, you must demonstrate that all aspects of this program function appropriately. In your test proof, be sure to include: • Proper entry and functioning of valid data • Invalid data attempts on all inputs, include “fuzzy” data attempts • Demonstration of multiple entries and accumulation. Insufficient testing proof will result in a diminished score. Submission Follow the instructions in the video “How to submit homework” to complete your homework solution. P a g e | 5 ISTM133P: Lesson 8 Assignment © 2021 Dr. Wayne Machuca Complete and submit the Girl Scout Cookie Order program only. Save this document for your records. Remember, your Python code MUST have your name and identification banner as described in the lectures. Value This assignment is worth 100 points. Notice increased lab value. Note: This document was checked for ADA Accessibility on June 29, 2020. Due to the programmatic nature of Python, portions of this document may be unintelligible to some screen readers.
Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here