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, 0 points are earned.

-If a customer purchases 1 book, 5 points are earned.

-If a customer purchases 2 books, 15 points are earned.

-If a customer purchases 3 books, 30 points are earned.

-If a customer purchases 4 or more books, 60 points are earned.

Write a program that asks the user to enter the number of books that he or she has

purchased this month and then display the number of points awarded

Respuesta :

fichoh

Answer:

n_books = int(input('Kindly enter the number of you've purchased this month'))

if n_books = 0 :

points_earned = 0

elif n_books = 1 :

points_earned = 5

elif n_books = 2 :

points_earned = 15

elif n_books = 3 :

points_earned = 30

elif n_books >= 4 :

points_earned = 60

Print('Thanks for your patronage, you now have', points_earned, 'points')

Explanation:

Using python :

n_books prompts the user to enter an integer value for the number of books purchased for the month

The integer is passed to a conditional if statement in other to find the appropriate number of points the user has earned,

After the points have been found then, the number of points is displayed using the print statement.