Question: Java Programming 8th edition by Joyce Farrel. Question 12. Chapter12 (Exception Handling). Please do not use methods not covered in the textbook! (i.e HashMap and
Java Programming 8th edition by Joyce Farrel. Question 12. Chapter12 (Exception Handling). Please do not use methods not covered in the textbook! (i.e HashMap and System.out.format). Thank you!
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, too low (less than 0), or too high (more than 9999). The quantity is not numeric, too low (less than 1), or too high (more than 12). The item number is not currently valid item. The companys current inventory consists of the items listed in Table 12-1. Item number, price Item 111, price 0.89 Item 222, price 1.47 Item 333, price 2.43 Item 444, price 5.99 Create a class that stores an array of usable error messages; save the file as OrderMessages.java. Create an Order Exception 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 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 exists in the entered data, compute the users total amount due (quantity times price each) and display it. Save the program as PlaceAnOrder.java.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
