Create a diagram that illustrates how your program works

Assignment Help JAVA Programming
Reference no: EM131943986

Assignment

Errors occur in programs, and there are two ways to address the problems. The first is to try to write code that checks for errors and then deals with them. For example, you can use error checking to see if a user selected a valid menu option after making a selection. Error checking tries to prevent errors from occurring. Another method is to go ahead and let errors occur but to handle them gracefully before they can affect the operation of the program. This method, called exception handling, will be the focus of this project.

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.

• Prepare a Word document, and upload it to the course portal.

Reference no: EM131943986

Questions Cloud

New machines offered by three different manufacturers : Assume that your company is considering the replacement of an automated milling machine with one of the new machines offered by three different manufacturers.
Discuss what the marketing mix is : Research, identify, and discuss what the marketing mix is as well as why it is important to a business. Write between 500 - 750 words (approximately 2 - 3 page)
How is this helpful in your understanding of fiscal policy : When have you seen representatives of the three dominant culture models and how have you been able to navigate these challenges?
Issue of mental health and effects mental patients : A big topic of conversation socially and politically has been the issue of mental health and the effects mental patients may have on society.
Create a diagram that illustrates how your program works : Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.
Company capital intensity ratio : Is the company’s“ capital intensity” ratio the same or different?
What occurrences can affect positive or negative outcomes : Compare and contrast Erikson's generativity versus stagnation stage with his ego integrity versus despair stage for middle and late adulthood.
List out two-three issues in the case : Case: Salesforce.com: Responsible Cloud Computing. List out two-three issues in the case. Explain the issues/talk about the issues.
Develop a web site that simulates a casino craps game : Develop a Web site that simulates a casino craps game. Use two web pages (php) to allow the user to play simple craps (dice).

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd