Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using java Then write a program that displays the following menu: 1. Fill array 2. Add a number 3. Find the index of a number

using java image text in transcribed
Then write a program that displays the following menu: 1. Fill array 2. Add a number 3. Find the index of a number 4. Remove number at index 5. Remove number 6. Quit Methodality We suggest that you develop your program incrementally. Meaning one menu item at a time. If it works correctly, add another one and so on. Use an int array of size 10. There should be no global variables at all, only constants are allowed. Use a variable to store the number of items the array contains (not all 10 elements will hold user data) For each menu item 0-6, write a method that takes the array name, the number of items in addition to other arguments (eg: the size of the array) if/when needed. 1. Fill array: Asks user how many numbers to fill (the length of the partially filled array). Validate the user entered number (1-10 inclusive). Fill the sorted array with random numbers 1-99 inclusive. The number of elements should be equal to the value specified by the user. Must use the provided insertSorted method. You may not add a number then sort the array. 2. Add a number: If array is full displays a message indicating that, otherwise add a random number in the correct position to the sorted array. You may not add a number then sort the array. 3. Find index of a number: Displays the index of a number specified by the user fit exists otherwise a message saying that the number is not found. 4. Remove number at index: Ask the user to enter the index. Remove the number at the specified index or display error message if the specified index is outside the current partially filled array size. 5. Remove number: Ask the user to enter a number, remove it if it exists otherwise display a message to indicate that it does not exist. Must use the provided deleteElement method. For searching, you must use the provided binary Search method. The provided methods may not be modified. Display the sorted array every time the menu is displayed

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

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions

Question

The board cannot act without a consensus of opinion.

Answered: 1 week ago