Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Next to the above lines, write a Python code that uses the input() function to ask the user to enter a number as unit

image text in transcribed

2. Next to the above lines, write a Python code that uses the "input()" function to ask the user to enter a number as unit price. Then, use an if.else structure (or if.elif..else structure or any variation of if structure) to determine the correct discount rate. Unit Price 0 - 29.99 30 - 59.99 60 - 74.99 100- Discounted Rate 2.5% 4.5% 5.5% 6.0% 3. Calculate the correct discounted unit price. (Hint: discounted unit price = unit price * (1- discount rate)] 4. Use the round()" function to round the calculated result to only two digits next to the decimal point. Then, display the discounted unit price with a "S" sign. Make sure the output looks similar to the following. [Hint: round (number, 2)] Enter the unit price: 25.69 Discounted unit price: $25.05 Enter the unit price: 47.86 Discounted unit price: $45.71 Enter the unit price: 71.35 Discounted unit price: $67.43 Enter the unit price: 104.82 Discounted unit price: $98.53

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions