A bookseller has a book club that awards points to its customers based on the nu
ID: 3638559 • Letter: A
Question
A bookseller has a book club that awards points to its customers based on the number of books they purchase each month. 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.
Write a program that asks the user to enter the number of books that he or she has purchased this month and then displays the number of points awarded.
Thanks!
Explanation / Answer
public static final int NUMBER_OF_BOOKS_I_READ_ON_PROGRAMMING= 0; public static final int THANKS_MOM_FOR_BUYING_THIS = 1; public static final int NUMBER_OF_TIMES_YOU_OPENED_YOUR_PROGRAMM… 2; public static final int NUMBER_OF_BOOKS_BOUGHT_FOR_PROGRAMMING_C… 3; public static final int TIMES_YOU_POSTED_ON_WEBSITES_FOR_HELP_ON… = 4; switch (some value goes here) { case NUMBER_OF_BOOKS_I_READ_ON_PROGRAMMING: case THANKS_MOM_FOR_BUYING_THIS: case NUMBER_OF_TIMES_YOU_OPENED_YOUR_PROGRAMM… case NUMBER_OF_BOOKS_BOUGHT_FOR_PROGRAMMING_C… case TIMES_YOU_POSTED_ON_WEBSITES_FOR_HELP_ON… }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.