Problem

A company accepts user orders for its products interactively. Users might make the follo...

A company accepts user orders for its products interactively. Users might make the following errors as they enter data:

The item number ordered is not numeric.

The quantity is not numeric.

The item number is too low (less than 0).

The item number is too high (more than 9999).

The quantity ordered is too low (less than 1).

The quantity ordered is too high (more than 12).

The item number is not a currently valid item.

Although the company might expand in the future, its current inventory consists of the items listed in Table 12-1.

Create a class that stores an array of usable error messages; save the file as OrderMessages.java. Create an OrderException class that stores one of the messages; save the file as OrderException.java. Create an application that contains prompts for an item number and quantity. Allow for the possibility of nonnumeric entries as well as out-of-range entries and entries that do not match any of the currently available item numbers. The program should display an appropriate message if an error has occurred. If no errors exist in the entered data, compute the user’s total amount due (quantity times price each) and display it. Save the program as PlaceAnOrder.java.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT