# Shipping is free for online orders totaling \$25 or more at Mississippi.com. Orders less than \$25 are charged \$6.00 for shipping. 7% sales tax is added for items that are taxable. A shopper is ordering one item, but possibly in multiple quantities. Write a program that prompts for the unit price of the item and the quantity desired. The program should also ask if the item is taxable and clearly indicate how the shopper should reply. Finally, the program should display a four line receipt that shows the extended price (subtotal) of the purchase, sales tax, shipping cost, and total amount due. All amounts should be in currency format as described in the requirements above.

Question
130 views

Shipping is free for online orders totaling \$25 or more at Mississippi.com. Orders less than \$25 are charged \$6.00 for shipping. 7% sales tax is added for items that are taxable. A shopper is ordering one item, but possibly in multiple quantities. Write a program that prompts for the unit price of the item and the quantity desired. The program should also ask if the item is taxable and clearly indicate how the shopper should reply. Finally, the program should display a four line receipt that shows the extended price (subtotal) of the purchase, sales tax, shipping cost, and total amount due. All amounts should be in currency format as described in the requirements above.

check_circle

star
star
star
star
star
1 Rating
Step 1

Note: You didn't mention any language so i use Python

#get the inputs from the user

unit_cost = float(input('Enter the cost of the item: '))

quantity = int(input('Number of items: '))

taxable = input('Enter the item is taxable or not? [y/n] ').lower()

#calculate the subtotal

subtotal = unit_cost * quantity

#check "taxable" is "y"

if taxable.startswith('y'):

#display the statement

print("\nThe item is taxable")

#calculate the "tax" amount

tax = subtotal * 0.07

#otherwise

else:

#set the value

tax = 0.0

#check "subtotal" is greater than or equal to 25

if subtotal >= 25.0:

#set the value

shipping = 0

#otherwise

else:

#set the value

shipping = 6.0

#calculate the "total" amount

total = subtotal + tax + shipping

#display the outputs

print('Subtotal: \$ {:.2f}'.format(subtotal))

print('Sales tax: \$ {:.2f}'.format(tax))

print('Shipping: \$ {:.2f}'.format(shipping))

print('Total: \$ {:.2f}'.format(total))

Step 2

Screenshot of the progra...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in