Use the code to answer the question.

if age > 40:
# 15 percent discount
discount = discount + (0.15 * amount)
if category == 'A':
# 10 percent discount
discount = discount + (0.1 * amount)
Revise the code to incorporate the given policies:

If the client is older than 40 and he buys from category “C,” he gets a discount of 55 percent.
All discount policies for category “A” are revoked.

(1 point)
Responses

if age > 40:
# 15 percent discount
discount = discount + (0.15 * amount)
if category == C:
# 55 percent discount
discount = discount + (0.55 * amount)
if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == C: # 55 percent discount discount = discount + (0.55 * amount)

if age > 40:
# 15 percent discount
discount = discount + (0.15 * amount)
if category == 'C':
# 55 percent discount
discount = discount + (5.55 * amount)
if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'C': # 55 percent discount discount = discount + (5.55 * amount)

if age > 40:
# 15 percent discount
discount = discount + (0.15 * amount)
if category == 'C':
# 55 percent discount
discount = discount + (0.55 * amount)
if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'C': # 55 percent discount discount = discount + (0.55 * amount)

if age > 40:
# 15 percent discount
discount = discount + (0.15 * amount)
if category == 'A':
# 55 percent discount
discount = discount + (0.55 * amount)
if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'A': # 55 percent discount discount = discount + (0.55 * amount)
Skip to navigation

Previous

1 answer

Based on the provided requirements, the code should be revised to apply a 55 percent discount for clients older than 40 who buy from category "C," while all discounts for category "A" should be revoked. The correct revised code snippet would be:

if age > 40:
    # 15 percent discount
    discount = discount + (0.15 * amount)
    if category == 'C':
        # 55 percent discount
        discount = discount + (0.55 * amount)

The responses using incorrect syntax or logic would not reflect these requirements. The only correct and complete version related to the new policy is the one provided above.

For a streamlined version without the unnecessary duplication, it clearly indicates that if the client is older than 40 and in category "C," they receive a 55 percent discount while maintaining the existing 15 percent discount (not applicable for category "A" anymore).

Similar Questions
  1. Use the code to answer the question.if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'A':
    1. answers icon 1 answer
    1. answers icon 1 answer
  2. Use the code to answer the question.if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'A':
    1. answers icon 1 answer
  3. Use the code to answer the question.if age > 40: # 15 percent discount discount = discount + (0.15 * amount) if category == 'A':
    1. answers icon 1 answer
more similar questions