Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows:
If a customer purchases 0 books, he or she earns 0 points.
If a customer purchases 1 book, he or she earns 5 points.
If a customer purchases 2 books, he or she earns 15 points.
If a customer purchases 3 books, he or she earns 30 points.
If a customer purchases 4 or more books, he or she earns 60 points.
# Program to calculate the points earned by customers at Serendipity Booksellers
# Ask the user to input the number of books purchased
books = int(input("Enter the number of books purchased: "))
# Set the points earned to 0 initially
points = 0
# Check the number of books purchased and assign the points accordingly
if books == 0:
points = 0
elif books == 1:
points = 5
elif books == 2:
points = 15
elif books == 3:
points = 30
else:
points = 60
# Print the points earned
print("You have earned", points, "points")
OUTPUT 1:
Enter the number of books purchased: 22
You have earned 60 points
OUTPUT 2:
Enter the number of books purchased: 2
You have earned 15 points