def calculate_discount_and_total(packages_purchased):
package_price = 99 # Price of one package
discount = 0 # Initialize the discount to 0%
if packages_purchased < 10:
discount = 0
elif 10 <= packages_purchased <= 19:
discount = 0.20 # 20% discount
elif 20 <= packages_purchased <= 49:
discount = 0.30 # 30% discount
elif 50 <= packages_purchased <= 99:
discount = 0.40 # 40% discount
else:
discount = 0.50 # 50% discount
total_amount = packages_purchased * package_price * (1 - discount)
return discount, total_amount
# Example usage:
packages_purchased = int(input("Enter the number of packages purchased: "))
discount, total_amount = calculate_discount_and_total(packages_purchased)
print(f"Discount: {discount * 100}%")
print(f"Total amount after discount: ${total_amount:.2f}")