Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Introduction To Management Accounting Chapters 1 To 14

Authors: Charles T Horngren, Gary L Sundem, William O Stratton, Dave Burgstahler, Jeff Schatzberg

15th Edition

0136102778, 9780136102779

More Books

Students also viewed these Accounting questions