Question: Scenario: You are developing a simple shopping cart system for an online store. The cart needs to calculate the total cost of the items, including
Scenario:
You are developing a simple shopping cart system for an online store. The cart needs to calculate the total cost of the items, including a discount if the total exceeds a certain amount.
Question:
Write a Python program that:
Takes the prices of items in the cart as input.
If the total exceeds $ applies a discount.
Prints the total cost after applying the discount if any
Sample InputOutput:
Input: prices
Output:
Total cost: $ discount applied
Group of answer choices
prices
total sumprices
if total :
discount total
total discount
printfTotal cost: $total:fDiscount applied
else:
printfTotal cost: $total:f
prices
total sumprices
if total :
discount total
total discount
printfTotal cost: $total:f discount applied
else:
printfTotal cost: $total:f
prices
total sumprices
if total :
discount total
total discount
printfTotal cost: $total:f discount applied
else:
printfTotal cost: $total:f
prices
total sumprices
if total :
discount
total discount
printfTotal cost: $total:f$ discount applied
else:
printfTotal cost: $total:f
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
