Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Java program that has a 10 element array of Integers. The program should assign test values to all 10 array locations. You can

Create a Java program that has a 10 element array of Integers. The program should assign test values to all 10 array locations. You can get these numbers from the user or initialize them as you see fit.

The program should ask the user (in a Console screen or have Textboxes, JOptionPanes, or other GUI components to accept the values) for an array position, retrieve the value at that location, and then ask user for a new value and use it to replace the original value at that location. Demonstrate a Multiple Exception Catch Try/Catch structure that only puts valid numbers in valid positions and checks for: (1) The program trying to put a value in an element that the array doesn't have and give an appropriate message to the user (2) The user entering a String value (like "Five") instead of a numeric integer value (like 5) and give an appropriate message to the user.

After that (or under a different control or set of controls if you did a GUI instead of a Console program) have the Program ask the user for two number positions 0-9 and show what the answer is when the value at the first position (the user chose) of the Array is divided by the value at second position (the user chose) . Make sure this is in a Try/Catch structure that gives an appropriate message if the value at second position (the user chose) of the array is zero (instead of doing it and crashing the program.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions

Question

Resolving conflicts starts with identifying problem ownership.

Answered: 1 week ago

Question

Prepare a constructive performance appraisal.

Answered: 1 week ago

Question

List the advantages of correct report formatting.

Answered: 1 week ago