Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODING IN PYTHON: Assume a customer is at a store purchasing exactly 4 items. The cashier inputs the items and their prices into the computer.

CODING IN PYTHON:

Assume a customer is at a store purchasing exactly 4 items. The cashier inputs the items and their prices into the computer. Someone has provided the cashier a Python program that does the following:

1. Asks cashier for name of each item (use short names like nails, paint, etc.)

2. Asks cashier for price of each item

A) Assume items are between $5 & $20. Have 1 item that is less than $10

3. Prints receipt header (see below for a sample receipt)

4. Prints item name and price as they are entered (Do this step four times, once for each product)

A) Input item name, item price, then print them

B) Keeps a running total

C) Keeps a running count of number of items purchased

5. Calculates and prints tax amount based on a certain tax rate

A) Use a CONSTANT to store tax rate

6. Prints a total that includes tax amount

7. Prints how much cash a person pays

A) Assume customer pays the exact or higher amount

8. Prints the amount of change (if any) to be returned to customer

Please note the following:

- Right-justify amounts

- Show $ signs

- Right justify items shown

- Leave plenty of blank lines in program for readability

- Have at least 4 - 5 comments

- Include pseudocode, englishcode, or flowchart (dont need all, just one of the three)

SAMPLE RECEIPT

__ ITEMS PURCHASED

______________________________________

Item 1

$__.__

Item 2

$_.__

Item 3

$__.__

Item 4

$_.__

Total (for 4 items)

$__.__

Tax - _%

$_.__

Total (incl. tax)

$__.__

Customer Paid

$__.__

Change to customer, if any

$__.__

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions