Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A store has a sale starting soon. Following code calculates and prints the discount for an item given its category and price. discount = 0

image text in transcribed

A store has a sale starting soon. Following code calculates and prints the discount for an item given its category and price. discount = 0 if (category == "sports"): if (price > 100): discount = 0.2 elif (price > 200): discount = 0.3 elif (category == "apparel"): if (price > 200): discount = 0.15 elif (price > 75): discount = 0.10 else: discount = 0.05 else: discount = 0.02 print("Discount: ", discount) For each of the cases below, what will be the output of the print statement above? Read the code carefully and follow it closely. a summer dress worth $75 (category="apparel, price=75): a tennis racket worth $255 (category = sports", price= 255): a cookware set worth $120 (category="kitchen, price=120)

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

4. Show the trainees how to do it again.

Answered: 1 week ago

Question

8. Praise the trainees for their success in learning the task.

Answered: 1 week ago