Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

=+10. What is the brand's character or personality?

Answered: 1 week ago

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago

Question

Write an expression for half-life and explain it with a diagram.

Answered: 1 week ago

Question

What do you mean by underwriting of shares ?

Answered: 1 week ago

Question

Define "Rights Issue".

Answered: 1 week ago

Question

=+ d. a professor deciding how much to prepare for class

Answered: 1 week ago

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago