Question
def refund(): status = input( ' Status i intact o open d damaged? ' ) if status == ' i ' : refund_rate = 100
def refund():
status = input( ' Status i intact o open d damaged? ' )
if status == ' i ' :
refund_rate = 100
elif status == ' o ' :
refund_rate = 90
else:
refund_rate = 80
return refund_rate
def restocking(tier):
if tier == 'gold' :
restocking_fee = 0
else:
restocking_fee = 50
return restocking_fee
#initialize
total = 0
product = int(input( ' Number of products? ' ))
for i in range(product):
items = int(input( ' Number of items? ' ))
price = float(input( ' Price ' ))
membership = (input( ' Membership type g gold s silver? ' ))
rate = refund()
fee = restocking(membership)
returned_items = items * price *rate /100
amount_returned = returned_items - fee
total += amount_returned
print( ' Amount returned: ' , amount_returned)
print( ' Total return' , total)
Assume that during the execution the user inputted the following data:
Number of products? 2
Number of items? 4
Price? 137
Membership type g gold s silver? g
Status i intact o open d damaged? o
Number of items? 5
Price? 130
Membership type g gold s silver? s
Status i intact o open d damaged? i
What is the value of the variable amount_returned at the end of the second interaction of the loop?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started