Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will be creating a driver class only for this assignment, however, the sorting method and searching method should be entirely outside the main method.

You will be creating a driver class only for this assignment, however, the sorting method and searching method should be entirely outside the main method.

Be sure to include a message to the user explaining the purpose of the program before any other printing to the screen.

Within the main method, please complete the following tasks:

Instantiate an array of 100 integers.

Populate the array with randomly generated numbers from 0 - 99.

Sort the array.

Using a loop that executes 5 times, generate a random number between 0 and 99 to search for within the array.Search the array for the value and print a message to the user indicating the value searched for, whether or not the value was found, and if it was found, at what subscript (see below for sample output).

Include clear comments throughout the program that explain the well named variables and what functionality the various lines/small sections of code are completing as related to the execution of the program.

Your output should look something like this:

After 4 searches, 28 was found at subscript 30!

After 6 searches, 11 was found at subscript 9!

After 7 searches, 7 was not found.

After 6 searches, 94 was found at subscript 94!

After 6 searches, 91 was found at subscript 91!

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 Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions

Question

explain what is meant by redundancy

Answered: 1 week ago