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

  1. Asks the user to enter the number of books that they have purchased this month.

  2. Displays the number of points awarded.

  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!