python program

profilehrutikkshroff
StartingFileforFinalProject-ChristmasShoppingList.py

#Python Final Project: Acme Department Store of Paramus #Author: Student Name Here #School: Pace University #Course: CIS101 #Instructor: Professor Michael Sidaras-Tirrito #Semester: Fall 2018 #Date Created: Write Date Here ### FUNCTIONS DEFINITION AREA ### def welcomeBanner(): #Written by Professor Tirrito - Leave it alone print("*******************************************************************") print("* *") print("* * Welcome to Acme Department Store of Paramus *") print("* *** 2500 State Route 17 North *") print("* ***** Paramus, New Jersey 07652 *") print("* ******* *") print("* ********* Christmas Shopping List Application *") print("* *********** ----------------------------------- *") print("* XXX Use our application to create a list of your *") print("* XXX loved ones that you shop for, and then update it*") print("* ------------ as you purchase the items in our store, and we *") print("* __\__/__ __\__/__ will let you know if you stayed in budget *") print("*|__|__|__||__|__|__| *") print("*| | | || | | | *") print("*|__|__|__||__|__|__| *") print("*| | | || | | | *") print("*|__|__|__||__|__|__| *") print("*******************************************************************") # Define the displayMenu function here. Be sure to start with 0 for the first menu item. - Professor Tirrito # Define the getChoice function here. def updateShoppingList(christmasShoppingList): #partially created by Professor Tirrito updateChoice = 0 # Write an asterisk-bordered banner below for the Update Shopping List Screen - Professor Tirrito for i in range(5): # output the value in i, followed by a string literal colon and the value in christmasShoppingList[i][0] to display the name of the loved one - Professor Tirrito # output a blank line - Professor Tirrito # output the prompt for the loved one you want to update, and then display a blank line - Professor Tirrito # write a statement that updates the christmasShoppingList where the first index is the updateChoice and the second index is the ninth element in the array. - Professor Tirrito # The new value for this update should be "Completed" - Professor Tirrito return def displayShoppingList(christmasShoppingList): #Partially created by Professor Tirrito # Initialize a variable called sum that defaults to 0 # Write an asterisk-bordered banner below for the Update Shopping List Screen - Professor Tirrito # output a blank line - Professor Tirrito print("") for i in range(5): for j in range(9): # output the item in the christmasShoppingList array where the first index is i and the second index is j. This will allow all array items to output - Professor Tirrito if (j == 3 or j == 5 or j == 7): #write a statement that updates the value of sum by adding back into itself the value of christmasShoppingList[i][j]. Remember you can use the += operator to do this - Professor Tirrito if christmasShoppingList[i][8] == "Completed": # Output the difference value as a dollar value by subtracting the budgeted amount in christmasList[i][1] - sum. Don't forget, the calculation needs to be converted to string - Professor Tirrito else: #Output the difference label without a dollar sign and then a continued string literal message that its not calculated until the record is Completed. - Professor Tirrito #This outputs a blank line between each loved one's record. Leave it alone. - Professor Tirrito print("") #This resets sum after each record is output, so it is correct for each record. Leave it alone. - Professor Tirrito sum = 0.0 print("***********************************************") return # Define the exitProgram function here ### MAIN PROGRAM DEFINITION AREA ### christmasShoppingList = [["Mom", 100.00, "Blouse", 50.00, "Perfume", 25.00, "Kindle", 80.00, "Pending"],["Dad", 100.00, "Tie", 15.00, "Scarf", 20.00, "Amazon Echo", 75.00, "Pending"],["Brother", 50.00, "Mario Kart", 50.00, "", 0, "", 0, "Pending"],["Sister", 50.00, "Cosmetics", 30.00, "Blouse", 25.00, "", 0, "Pending"],["Grandma", 100.00, "Godiva Chocolates", 45.00, "Galaxy Tab", 75.00, "", 0, "Pending"]] #Written by Professor Tirrito. Does not need to be modified. # Initialize totalSpent, differenceSpent, and choice here - Professor Tirrito while (choice !=2): # Partially programmed by Professor # Call the welcome banner function written by your professor now - Professor Tirrito # Call the display menu function now - Professor Tirrito # Call the get choice function now and assign its return value into choice - Professor Tirrito if (choice == 0): # Call the updateShoppingList function here, being sure to pass in the name of the array that contains the shopping list - Professor Tirrito elif (choice == 1): # Call the displayShoppingList function here, being sure to pass in the name of the array that contains the shopping list - Professor Tirrito else: # Call the exitProgram function here - Professor Tirrito ### THIS IS THE END OF THE FINAL PROJECT SOURCE CODE FILE. YOUR FINAL PROJECT SHOULD BE DONE! --Professor Tirrito ###