Java project

Assignment Help Operation Management
Reference no: EM132827142

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.

- Create a zip that includes your project folder and Word document, and upload it to the course portal.

Reference no: EM132827142

Questions Cloud

Movement westward by sizeable population : There was a large westward expansion movement between the years of 1815 and 1850. Examine this movement westward by a sizeable population.
External environmental scan for your organization : Identifies and analyzes the most important external environmental factor in the remote, industry, and external operating environments
Utilization management and models of care : Health care providers and interested parties must continuously look for ways to manage limited resources while improving quality and promoting patient safety
Document lawsuit that involved particularly egregious action : Access the EEOC website. Document a lawsuit that involved particularly egregious actions but that likely did not receive any significant media attention.
Java project : Errors occur in programs, and there are two ways to address the problems. Create a new project in your IDE named "ExceptionHandler."
Explain three short-term and three-long term goals : List and explain three short-term and three-long term goals that you have set for your future. What measures or actions must you take to obtain these goals?
Definition with the ways that humans naturally think : Define critical thinking and contrast this definition with the ways that humans naturally think.
Alleviate unwarranted stress in your daily routine : What are some critical steps you can take to alleviate unwarranted stress in your daily routine, or proactively conquer reoccurring stressors?
How to effectively reduce negative effects encountered : When dealing with stress, one must learn how to effectively reduce the negative effects encountered.

Reviews

Write a Review

Operation Management Questions & Answers

  What are the various threats to information security

Private and corporate information is under attack from an array of resources. What are the various threats to information security in your view? Are you doing your share to protect your information? Why and why not? What can you do to improve your in..

  Groups requires cooperating and collaborating

Working together in groups requires cooperating and collaborating with others. It also requires motivation.

  What are the general tradeoffs

Managers typically consider five measures when evaluating waiting line performance, but which is the most important and why?

  Largest manufacturer and marketer of high-quality

CUTCO Corporation, the largest manufacturer and marketer of high-quality kitchen cutlery and accessories in the United States and Canada, celebrated its 60th anniversary in 2009. The company's FOREVER guarantee ensures that CUTCO cutlery stays in the..

  Illustrate what strategy decisions are needed in personal

Illustrate what strategy decisions are needed in personal selling area. Explain why should marketing manager make se strategy decisions.

  What is the role of the security exchange commission

What factors have to be at work to allow something like the Bernie Madoff "Ponzi Scheme" to be as successful as it was for as long as it was? What is the role of the Security Exchange Commission in the Madoff Scandal.

  Constantly changing business environment

Some of the major issues facing operations management executives today in this constantly changing business environment are the following:

  Health maintenance organization

Which of the following is probably cheapest for an employer to offer: HMO, PPO, or HDHP? and Why? Health Maintenance Organization. High-deductable Health Plan

  What is the optimal order size in bags

Powered by Koffee (PBK) is a new on-campus coffee shop. What is the optimal order size (EOQ), in bags?

  Effective solution would be to install scrubber system

After investigating numerous alternatives, you find most effective solution would be to install a “scrubber” system, which will remove 90% of the pollutants

  Law requiring paint manufacturers to recycle paint

The State of Minnesota passed a law requiring paint manufacturers to recycle paint.

  Find a mentor or colleague and ask them to review

Find a mentor or colleague and ask them to review and provide feedback on the resume you created in Week 4.

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