Question: 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

 2. Next to the above lines, write a Python code that

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!