Question: Please Help! This exercise requires designing a program which solves the problem described in the problem statement below. Provide comments for your pseudo-code and Java
Please Help!
This exercise requires designing a program which solves the problem described in the problem statement below. Provide comments for your pseudo-code and Java program as necessary.
You may use Flowgorithm to construct your program and then copy/paste the Gaddis Pseudo-code and Java Code created from your Flowgorithm program to complete the Assignment.
The components that comprise your solution are described below:
- Flowchart. Use Lucidchart to complete this part of the assignment. Keep in mind that even though Flowgorithm uses mostly standard flowchart symbols, the result is not a standard flowchart. Use examples in your text and the Practice Problem above as a guide for completing your flowchart. You should save and download your flowchart from Lucidchart as a PNG file and insert it into your Word Assignment file.
- Pseudo-code. Obtain pseudo-code for your Assignment from Flowgorithm by (1) selecting Tools and Source Code Viewer, (2) clicking the dropdown list arrow and (3) selecting Gaddis Pseudo-code. If you click the Copy to Clipboard icon after the pseudo-code is displayed, you can paste it into the Word Assignment file.
- Program Coded. Obtain Java Code from Flowgorithm by (2) selecting Tools and Source Code Viewer, (2) clicking the dropdown list arrow and (3) selecting Java. If you click the Copy to Clipboard icon after the pseudo-code is displayed, you can paste it into the Word Assignment file.
- Program Output. For this assignment, you should obtain a screen shot of the results produced from executing your Java code in Netbeans or another comparable integrated development environment (IDE). You may copy/paste your code from Flowgorithm to Netbeans, making all necessary adjustments. Please review how to enter, compile, and run a Java program in the video "Writing Your First Java Program Using Netbeans". The link from Module 1 is copied under the heading Recommended Readings and Assignments above.
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
Get step-by-step solutions from verified subject matter experts
