191k views
1 vote
For this program you will be writing a program that will use if-else or if-elif-else statements. Read-It-All bookstore has a book sales club where customers can earn reward points that can be used for their next purchase. If a customer purchases 0 books, he/she earns 0 points. If a customer purchases 1-3 books, he/she earns 5 points. If a customer purchases 4-6 books, he/she earns 10 points. If a customer purchases 7-8 books, he/she earns 15 points. If a customer purchases 9 books, he/she earns 20 points. If a customer purchases 10 or more books, he/she earns 25 points. Write a program that asks the user to enter their name (Firs

1 Answer

6 votes

Answer:

name = input("Enter your name: ")

books = int(input("Enter he number of books you purchased: "))

points = 0

if 1 <= books <= 3:

points = 5

elif 4 <= books <= 6:

points = 10

elif 7 <= books <= 8:

points = 15

elif books == 9:

points = 20

elif books >= 10:

points = 25

print(name + " has " + str(points) + " points")

Step-by-step explanation:

*The code is in Python.

Ask the user to enter the name and number of books purchased

Check the number of books purchased. Depending on the given conditions, set the points s/he earned.

Print the name and points s/he has

User DriverBoy
by
5.7k points