A company accepts user orders by part numbers interactively. Users might make the following errors as they enter data: - The part number is not numeric. - The quantity is not numeric. - The part number is too low (less than 0). The part number is too high (more than 999). - The quantity ordered is too low (less than 1). - The quantity ordered is too high (more than 5,000). - - - Create a class that stores an array of usable error messages; save the file as DataMessages.java. Create a DataException class; each object of this class will store one of the messages. Save the file as DataException.java. Create an application that prompts the user for a part number and quantity. Allow for the possibility of nonnumeric entries as well as out-of-range entries, and display the appropriate message when an error occurs. If no error occurs, display the message "Valid entry". Save the program as PartAndQuantityEntry.java.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question
A company accepts user orders by part numbers
interactively. Users might make the following errors as
they enter data:
- The part number is not numeric.
The quantity is not numeric.
- The part number is too low (less than 0).
- The part number is too high (more than 999).
- The quantity ordered is too low (less than 1).
- The quantity ordered is too high (more than 5,000).
Create a class that stores an array of usable error messages; save
the file as DataMessages.java. Create a DataException class;
each object of this class will store one of the messages. Save the
file as DataException.java. Create an application that prompts the
user for a part number and quantity. Allow for the possibility of
nonnumeric entries as well as out-of-range entries, and display the
appropriate message when an error occurs. If no error occurs,
display the message "Valid entry".
Save the program as PartAndQuantityEntry.java.
Transcribed Image Text:A company accepts user orders by part numbers interactively. Users might make the following errors as they enter data: - The part number is not numeric. The quantity is not numeric. - The part number is too low (less than 0). - The part number is too high (more than 999). - The quantity ordered is too low (less than 1). - The quantity ordered is too high (more than 5,000). Create a class that stores an array of usable error messages; save the file as DataMessages.java. Create a DataException class; each object of this class will store one of the messages. Save the file as DataException.java. Create an application that prompts the user for a part number and quantity. Allow for the possibility of nonnumeric entries as well as out-of-range entries, and display the appropriate message when an error occurs. If no error occurs, display the message "Valid entry". Save the program as PartAndQuantityEntry.java.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage