Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language = Java Create a program to receive book prices until a sentinel value is entered. (Be sure to tell your user what the sentinel

Language = Java

Create a program to receive book prices until a sentinel value is entered. (Be sure to tell your user what the sentinel value is so they can type it to indicate they are finished with entering input.) After the sentinel value is entered, compute the total book order total and return the following to the user.

As book prices are entered, you'll need to have some way to capture the number of books they ordered and the running subtotal for use in the total book order price.

Compute the tax and shipping as usual (tax is 5.5 percent of the total book price & shipping charge is $1.50 per book). The price of the order is still the sum of the total book price, the tax, and the shipping charge. Output a receipt formatted as the following:

Enter the book price and press enter or type 999 when you are finished added books: 12.22

Enter another book price and press enter or type 999 when you are finished added books: 12.00

Enter another book price and press enter or type 999 when you are finished added books: 13.33

Enter another book price and press enter or type 999 when you are finished added books: 999

Number of books purchased: 3

Book Subtotal: $37.55

Tax: $2.07

Shipping: $4.50

------------------------

Order Total: $44.12

IMPORTANT TESTING NOTE: Double check your math to make sure your sentinel value isn't being added into the book total and that you don't end up with an extra book in the number of books purchased. You can prevent that by setting up your loop correctly. If you are subtracting 1 from the book count or subtracting the sentinel value, you do not have your loop set up correctly.

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_2

Step: 3

blur-text-image_3

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Define auditing, attest, and assurance services.

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago