A uml activity diagram that illustrates how program works

Assignment Help JAVA Programming
Reference no: EM13771697

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: EM13771697

Questions Cloud

What business formation would you suggest : What business formation would you suggest they choose to organize their business enterprise? Please discuss the advantages and disadvantages of your choice, and also discuss alternative business formations that Anthony and Eric could choose to org..
Natural ecosystem in your area : The major structural and functional dynamics of your selected ecosystem How humans may have affected the cycling of matter in ecosystems, including effects to the nitrogen, phosphorus, or carbon cycle
Furnishings and equipment damage : The landlord carries contents insurance that should cover the damage to the furnishings, equipment, and to the computers, and the insurance company adjuster will come tomorrow to assess the furnishings and equipment damage.
Compute the multifactor productivity under each system : Compute the multifactor productivity under each system. Use carts per dollar cost (labor plus equipment) as the measure. (Round your answers to 2 decimal places.)
A uml activity diagram that illustrates how program works : Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.
What is bribery and what are the issues caused by bribery : What is bribery, and what are the issues caused by bribery? How would you deal with bribery if you were faced with the issue?
What are victimless crimes : What are victimless crimes, and why are they controversial? Be sure to provide examples
Private firms that benefited from government protection : Multinational enterprises are sometimes compared to colonial enterprises that operated at the end of the 19th century. Colonial enterprises were often private firms that benefited from government protection and control of foreign countries. Is this a..
Discrimination complaint and civil litigation processes : Prepare a 700- to 1,050-word paper in which you analyze and explain the following discrimination complaint and civil litigation processes as it would potentially apply to John and his employer

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java shape program console

Program is adequately documented. It's comments identifies its name, purpose, author and date.Throughout the code, comments and/or relevant component names should attempt to make theprogram understandable.

  Compute the sum of the first n positive odd integers

Write JAVA program that will compute the sum of the first n positive odd integers.  For example, if n is 5, you should compute 1 + 3 + 5 + 7 + 9.

  The program should ask the user to enter the student'' answer

Your program should store these correct answers in an array. (Store each question's correct answer in an element of a string array.) the program should ask the user to enter the student's answers for each of the 20 questions, which should be stored i..

  Implementation of the vector data type

Described in general terms the implementation of the vector data type. Complete the implementation of the vector by providing definitions for the subsequent operations

  What is the average response time for this system?

A web server receives a request every 50ms and processes web requests every 8 ms. Using queuing theory, 1. What is the average response time for this system?

  Program produces 1000 integer ranging

Then your program produces 1000 integer ranging from 1to 10000 in the array and then sort them in ascending order and then print the result into data.txt file. (You may list integers separated by space or new line)

  Modify each sorting algorithm

Modify each sorting algorithm so that it keeps track of the number of comparisons it performs and the number of exchanges (swaps) it performs during a single sorting operation. Keep track of these numbers using two long integer counters

  Create java application which creates random phone number

Create and implement Java application which creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output.

  Develop a complex web site

Develop a complex web site or piece of multimedia from scratch, using information gathering and design techniques;

  The desired functionality is for your programs to input

the desired functionality is for your programs to input pairs of natural numbers as theyre entered by the user until

  Qr codes are a popular way

QR codes are a popular way to encode data for easy reading by computerized cameras. True QR codes contain error correction, format specifiers, version information, and a size variable layout that makes them harder to decode and process

  Create a program named schoolsdemo

Create a program named SchoolsDemo that allows a user to enter data about five school objects and then displays the school objects in order of enrollment size from smalles to largest.

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