Java program

For this project, you will write a Java program that demonstrates exception handling. Your program will accept from the user ten numbers and place them in an array. The numbers in the array will be added together and the result displayed to the user. The program will compare the values for the first two elements in the array (only) and determine which number is larger and report that information on screen. Then divide the larger number by the smaller number and report the result of that calculation. The program must use exception handling to avoid division by zero errors or out of range errors, then present a friendly error message to the user. The program must then repeat (loop), prompting the user for new data entry. When the user enters 9999, the program must terminate on the next loop cycle, and this must be indicated in the program text (“Enter 9999 to exit.”)

Project Steps:

Don't use plagiarized sources. Get Your Custom Essay on
Java program
Just from $13/Page
Order Essay
  • Create a new project named “ExceptionHandler.” (Custom classes are not needed.)
  • Write code to accept numbers entered by the user.
  • Use error handling to ensure that only numbers are accepted.
  • Write code to add all values in the array together and display the result to the user.
  • Write code to compare the first two values in the array and report the results
  • Write code to divide the larger number by the smaller number from the above comparison
  • Use error handling to ensure that the program doesn’t crash if it attempts to divide a number by zero.
  • Prompt the user for another set of ten numbers.
  • If the user entered 9999 during data entry in the last loop cycle, terminate the program.
  • Use exception handling to manage out of range exceptions (only numbers are entered)
  • Use exception handling to manage division by zero exceptions (as noted)
  • Use exception handling to manage by default any errors that don’t fall into the above categories.
  • Using Catch blocks, display the cause of any exceptions to the user.
  • Output instructions to the screen so that the user will know how to operate the program and what to expect.
  • Use code comments to annotate your code, indicating what each line of code does as well as how it works.
  • Make sure the program runs correctly before submission. (Your instructor is here to help!)
  • Create an activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.
  • Formal UML is not required but may be used if preferred. (You may use any software for this, but it must be submitted in Microsoft Word.)
  • ZIP your project folder and submit that and your Word document (containing the activity diagram) to the portal for grading.

This assignment will also be assessed using additional criteria provided (see attachment).

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!
Live Chat 1 763 309 4299EmailWhatsApp

Order your essay today and save 15% with the discount code GINGER