Need programming help with Exception Handling

Dec 10th, 2015
Sigchi4life
Category:
Programming
Price: $20 USD

Question description

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. 


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Cornell University
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
darnay
Nov 30th, 2016
" The best tutor out there!!!! "
dontuwannaknow
Nov 21st, 2016
" Excellent work as always thanks so much "
SjSurvivor143
Nov 7th, 2016
" Thanks for the help. "
ddg82
Oct 29th, 2016
" Thanks, good work "
tinytim47
Oct 16th, 2016
" Wow this is really good.... didn't expect it. Sweet!!!! "
jestin7
Oct 7th, 2016
" This tutor is great! "
mixedballz
Oct 2nd, 2016
" excellent work as always thanks for the help "
lilmoe415
Sep 23rd, 2016
" Thank you, Thank you, for top quality work, this is your guy!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1825 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors