Ask Computer Engineering Expert

Using Arrays with Sorting and Searching Algorithms
(based on Module 4 material)
1) This program has six required outputs and involves searching and sorting an array of integers.
prepare a Java application that initializes an array with the following numbers, in this order:
23, 17, 5, 90, 12, 44, 38, 84, 77, 3, 66, 55, 1, 19, 37, 88, 8, 97, 25, 50, 75, 61, and 49
Then display the unsorted values. This is required output #1 of 6 for this program.
Using a sequential search of the unsorted array, determine and report the 1-relative (i.e. 1, 2, 3, 4, etc.) positions of the following numbers in the array (or -1 if not found), and the number of searches required to  locate the numbers: 25, 30, 50, 75, and 92. This is required output #2 of 6.
Then display the total number of searches for all five numbers. This is required output #3 of 6.
Sort the numbers using any algorithm of your choice and then display the sorted array. This is required output #4 of 6.
Using a binary search of the sorted array, determine and report the 1-relative positions of the following numbers in the array (or -1 if not found), and the number of searches required to locate the numbers: 25, 30, 50, 75, and 92. This is required output #5 of 6.
Finally, display the total number of searches for all five numbers. This is required output #6 of 6.
(There are six required sets of output as numbered in the above paragraphs.) Try to create an object-oriented solution for your solution vs. a procedural one. For ex, you might have a class that stores an array passed by a driver class, with methods for sorting the array, searching the array via a sequential search, searching the array via a binary search, and output the current contents of the array. The driver class could not only pass in the initial array values but call various methods to perform the searches, sorting, and array contents display. You may use any output type class you want (e.g. Scanner, JOptionPane). 
Be sure that you include the course, the program number, your name, and the date in your program header. Include additional comments as necessary and maintain consistent indentation for good programming style as shown in the text. Be sure that you capture all of your output for this program's execution for full credit!
2) You may use any Java Integrated Development Environment (IDE) you choose to develop your source code, compile and link your code, and execute your program (jGRASP is recommended). Or you may use the Windows Command Prompt. 
You are to submit the following deliverables in a single Microsoft Word file in this order, and clearly labeled. 
a) A screen snapshot of your Java source code (all file(s) shown separately) displayed in the IDE or Windows editor showing a successful compilation if possible (only the beginning of the source file(s) are necessary).b) A listing of your entire source code file(s).
c) A screen snapshot of all of your program's outputs for the specified values in Step #1. For this program there are 6 (six) total sets of item(s) to be output. Failure to show any of them will result in lost points. In order not to confuse the grading process, and possible lose points, do not include any other outputs besides these six items.
3) Your instructor may compile and run your program to verify its correctness.
4) You will be evaluated on (in order of importance):
a) Following directions and inclusion and packaging of all deliverables in Step #2.
b) Correct execution of your program (this includes proper compilation). This also includes getting the correct answers!
c) Proper commenting of your Java code and indentation (as specified in the text).
d) Neatness in packaging of your deliverables (to include putting the items in Step #2 in the correct 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9100239

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As