Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fenwick Books has asked you to create a program to help calculate a receipt for books purchased. Wirte a Java program that will take in

Fenwick Books has asked you to create a program to help calculate a receipt for books purchased. Wirte a Java program that will take in the number of books ordered and the total price of all books as user input.

Then, the program should perform the following calculations:

  • Calculate the sales tax associated with the book order based on a rate of 6%
  • Calculate the cost of shipping ($1.50 per book)
  • Calculate the grand total cost of the order, including shipping and tax

Finally, the program must print a receipt containing the number of books purchased and the grand total cost of the order. Printed dollar amounts must be formatted to two decimal places.

The example run below shows how the program would run. Note, user input is denoted in orange.

Enter the number of books purchased: 3

Enter the total price of all books: 106.10

**Fenwick Books - Receipt** Number of Books Purchased: 3 Grand Total: $116.97 Note: For input/output, you must use the JOptionPane class. For this lab only, you may assume the user will only enter in valid information. For example, you do not need to account for a negative number of books purchased.

Hint: Remember Integer.parseInt and Double.parseDouble from the lecture notes when gathering input and String.format for outputting dollar amounts!

Your code must compile using the jGrasp IDE. If your code does not compile using jGrasp (for any reason), a grade of 0 will be earned. No exceptions!

Upload your completed .java file. Make sure you upload the .java file and not the .class file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

Define small business.

Answered: 1 week ago

Question

2. To what extent do we need to be told how language works?

Answered: 1 week ago

Question

e. What are notable achievements of the group?

Answered: 1 week ago