Question 1
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.

Question 2
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 and .
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.

Extra Questions:
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?

Solution PreviewSolution Preview

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.

    $30.00 for this solution

    PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

    Find A Tutor

    View available Java Programming Tutors

    Get College Homework Help.

    Are you sure you don't want to upload any files?

    Fast tutor response requires as much info as possible.

    Upload a file
    Continue without uploading

    We couldn't find that subject.
    Please select the best match from the list below.

    We'll send you an email right away. If it's not in your inbox, check your spam folder.

    • 1
    • 2
    • 3
    Live Chats