Using exceptions, write a Java application CheckValue with the following specification: The application defines an integer variable taking legal values within the range -9 .. 9 inclusively and invites the user to enter a value for this variable. If the user enters a legal value, it will be assigned to the variable, the message “Initialization completed” will be displayed and the program execution terminates. If an illegal value is entered, it will be identified and reported by displaying an appropriate message at the console and the user will be invited to re-enter a legal value. The following situations should be identified and reported: s1 - the user has entered an integer number outside the specified range (such as 10); s2 - the user has entered a non-integer number (such as 15.43) and s3 - the user fails to enter a number (such as nine). Be sure your code compiles and runs as expected.
Consider a Java interface WarehouseProcessing consisting of the following abstract methods suitable for the management of a warehouse of different products: addToExistingStock,deliverFromExistingStock and isEmptyStock.
(a) Design the interface methods by considering and discussing their arguments and return type. Consider that each product in the warehouse is identified by a unique id.
(b) Write the Java code for the interface WarehouseProcessing.
Be sure your code compiles without errors.
1. Java source files CheckValue.java and WarehouseProcessing.java .
2. A document file (.pdf or .doc/.docx) containing the following elements: (1) Short questions discussion / analysis, (2) Design decisions and assumptions, (3) Relevant test cases and two relevant screenshots for the CheckValue program, (4) Error handling, (5) Lessons learned and (6) Possible improvements. The size of the document file (including the screenshots) should be of 2 pages, single spaced, font size 12.
1. Explain the role of a Layout Manager in the context of Java GUI programing. What happens when a Java GUI program fails to explicitly define and use a Layout Manager?
2. What are the main steps of defining and using a Layout Manager in a GUI based application?
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.