Question
Help, need a java code for this problem and I need a flowchart as well. It can not be Python. Problem Statement Design a program
Help, need a java code for this problem and I need a flowchart as well. It can not be Python.
Problem Statement
Design a program that
-
Asks the user to enter the number of books that they have purchased this month.
-
Displays the number of points awarded.
-
If the user enters a value less than 0, it will display an error message and will not display any points.
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 shown below. If the customer purchases:
-
0 books, they earn 0 points
-
1 book, they earn 5 points
-
2 books, they earn 15 points
-
3 books, they earn 30 points
-
4 or more books, they earn 60 points.
Your program should contain the following:
-
Module main. Asks the user how many books were purchased. Passes the number of books purchased to pointsEarned.
-
Module pointsEarned. Uses a decision statement to determine the number of points earned based on the number of books purchased.
Expected Output
How many books did you purchase? 10
You earned 60 points.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started