For this project, you will write a Java program that demonstrates exception handling. Your program will accept from the user ten values and place those numbers in an array. The numbers in the array will be added together and the result displayed to the user. The program will also perform division. The program should compare the values for elements 1 and 2 in the array and divide the larger number by the smaller number. It should compare the values for all odd/even elements and divide the larger by the smaller value. The program should use exception handling to avoid division by zero errors or out of range errors (dictated by the variable’s data type) which would cause the program to stop due to the error. The program should prompt the user for a second set of ten numbers. When the user enters 9999 the program should terminate normally. For this project, do the following:
Create a new project in your IDE named “ExceptionHandler.”
Write code to accept numbers as described above from the user. Your code should ensure that only numbers are accepted.
Write code to add all values together and to divide larger numbers by smaller numbers in odd/even elements. Results should be displayed. Loop to get another set of ten numbers from the user until the user enters 9999 as the first number.
Use exception handling to handle division by zero and out of range exceptions.
In the catch blocks, be sure to display the cause of the exception to the user.
Make sure your exception handler will handle any other errors as a default.
Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.
Use good comments to describe how the program works.
Make sure the program runs correctly before submission.
Create a zip that includes your project folder and Word document, and upload it to the course portal.
This assignment will also be assessed using additional criteria provided here.
Grading Criteria
Project Creation
Create a new project in your IDE named “ExceptionHandler.” According to the program criteria stated.
20%
User Input and Calculation
Write code to accept 10 numbers from the user and placed in an array.
Your code should ensure that only numbers are accepted.
The numbers in the array will be added together and the result displayed to the user.
The program should compare the values for elements 1 and 2 in the array and divide the larger number by the smaller number.
It should compare the values for all odd/even elements and divide the larger by the smaller value.
The program should prompt the user for a second set of ten numbers. When the user enters 9999 the program should terminate normally.
30%
Exception Handling
Use exception handling to handle division by zero and out of range exceptions.
In the catch blocks, be sure to display the cause of the exception to the user.
Make sure your exception handler will handle any other errors as a default.
30%
Source Code Mechanics
Code is well documented with comments.
Code uses appropriate style and naming conventions.
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!