Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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) it 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 thay 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 filed array size. 5. Remove number: Ask the user to enter a number, remove it if it exists otherwise display a 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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions