Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that asks the user to enter a current cart amount as a float value, and whether they are a member of the
Write a program that asks the user to enter a current cart amount as a float value, and whether they are a member of the business. The prompts should be: - Enter the current cart amount: - Are you a member? (yeso): The program should display the discount rate and the final price, based on the following schedule. - If part of the membership program: Amount smaller than $1002% discount Amount is greater than or equal to $100 and smaller than $2004% discount Amount is greater than or equal to $200 and smaller than $3008% discount - Amount is greater than or equal to $300 and smaller than $50010% discount Amount is greater than or equal to $50015% discount - If not part of the membership program: - Amount smaller than $300 - No discount Amount is greater than or equal to $300 and smaller than $5004% discount Amount is greater than or equal to $5008% discount Notes: - You can assume that the response to the question of membership will be the word "yes" or "no" in lower case letters. - The final price should be rounded to 2 decimal places. - The output must be in the format shown in the examples, including the format of the prompt, spaces, and punctuation. - You may find nested conditions to be efficient here. - Even though you are comparing float values, you do not need to use a tolerance here, as the amount entered by the user is large enough to avoid problems with rounding approximations. For example
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