Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the code in Python Programming Project #2 Assignment Overview The data in an online shopping cart, as the shopper is buying, is stored into

image text in transcribed
image text in transcribed
Write the code in Python
image text in transcribed
Programming Project #2 Assignment Overview The data in an online shopping cart, as the shopper is buying, is stored into the computer's memory within a container, such as a list, and then displayed for the shopper to review. Program Specifications Your program will prompt the user for the description of the product, the quantity and the price of 3 items. The data will be stored into three separate parallel lists (one for the descriptions, one for the quantities and one for the prices.) Later, when we cover looping within our programs, and conditional execution of statements using if statements, we could make this code a little more realistic. For now, it is important that you understand how to work with lists because much of our financial data analytics will be working with lists. Once the data has been stored into the lists do the following: Display the data for each product in a tabular form with heading labels, including the total value (unit price times quantity) Display the description of the product with the largest price (from the list class, use methods max and then index to find the location of that value from the list class). Don't worry about if there are two values exactly the same. It will return the index of the first one. For this program, that is acceptable. Calculate and display the total sales (sum of all the total values) Notes: program 2 (Compatibility Mode] - Word m Layout References Mailings Review View Help Acrobat Tell me what you want to do Your program will prompt the user for the description of the product, the quantity and the price of 3 items. The data will be stored into three separate parallel lists (one for the descriptions, one for the quantities and one for the prices.) Later, when we cover looping within our programs, and conditional execution of statements using if statements, we could make this code a little more realistic. For now, it is important that you understand how to work with lists because much of our financial data analytics will be working with lists. Once the data has been stored into the lists do the following: Display the data for each product in a tabular form with heading labels, including the total value (unit price times quantity) Display the description of the product with the largest price (from the list class, use methods max and then index to find the location of that value from the list class). Don't worry about if there are two values exactly the same. It will return the index of the first one. For this program, that is acceptable. Calculate and display the total sales (sum of all the total values) Notes: You MUST use Parallel lists that contain elements that are associated with one another through the index. So DescriptionList[O] and Pricelist[0] contain the description and price of the first item in the shopping cart. To add an element to a list you must use the append method. The input statement returns a string so for price (a float) and quantity (an integer) you must convert the user's response to the appropriate data type. To get your data nicely formatted on the screen see slide 15-16 of week4 powerpoint T ... Bi e p o o 9 P3 9w] esign Layout References Mailings Review View Help Acrobat Tell me what you wan 1 . 1. 1. 2 . 3 3 . 4 . 5 Sample Run Enter the price of your first item99.95 Enter the description of your first itemHumidifier Enter the quantity for this item1 Enter the price of your second item25 Enter the description of your second itemclock Radio Enter the quantity for this item3 Enter the price of your third item1278.99 Enter the description of your third itemSmart TV Enter the quantity for this item2 Here is your Shopping Cart: Quantity Description Humidifier clock Radio Smart TV Price 99.95 25.00 $ 1278.99 Totalvalue $ 99.95 $ 75.00 $ 2557.98 NW

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Did Elizabeth use visual aids effectively?

Answered: 1 week ago