Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Write a python prgram - without using global variables. Write a program for a store's Express Checkout cashier. This express checkout allows up to five

Write a python prgram - without using global variables. Write a program for a store's Express Checkout cashier. This express checkout allows up to five different items, but shoppers can have multiple quantites of each item. In the main function, prompt the shopper for the number of items. If a shopper has more than five items, direct the shopper to another lane. Otherwise, start a loop that prompts the user for the quantity and unit price of each item, and calls a value-returning function named item_cost with these inputs as arguments. The item_cost function should return a subtotal for that item to main for printing. After all items have been processed, the program should print the total amount owing. See sample outputs below. NOTE: all currency outputs should display two decimals with the $ sign immediately before the first digit. The loop can be a for loop or a while loop. Your choice.

Example:

Express checkout. Maximum 5 items How many different items do you have? 3 Enter quantity of item #1 2 Enter unit price of this item 2.49 Subtotal: $4.98 Enter quantity of item #2 1 Enter unit price of this item 3.99 Subtotal: $3.99 Enter quantity of item #3 4 Enter unit price of this item 1.19 Subtotal: $4.76 Total: $13.73 Thank you. We appreciate your business

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions