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 a currently valid item. The company’s current inventory consists of the following items listed in Table: item number                       price 111                                      0.89 222                                       1.47 333                                       2.43 444                                       5.99 Create a class that stores an array of usable error messages; save the file as OrderMessages.java. Create your own 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.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 6RA
icon
Related questions
Question
  1. 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 a currently valid item.

The company’s current inventory consists of the following items listed in Table:

item number                       price

111                                      0.89

222                                       1.47

333                                       2.43

444                                       5.99

Create a class that stores an array of usable error messages; save the file as OrderMessages.java. Create your own 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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr