Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java class named aMergeSortDoubles.java that accepts an integer command line argument Use that integer argument to create an array of Doubles (use the

  • Write a Java class namedaMergeSortDoubles.javathat accepts an integer command line argument
  • Use that integer argument to create an array of Doubles (use the Wrapper class)
  • Initialize the array with double values in the range of the length of the array

  • For example, if the array length is 10, each value can be 1.0-10.0
  • Use a loop to display each random value of the array, labeled as "Random array..."
  • Use a row of hyphens "----------------------" to separate the label from output
  • Since doubles can be long, consider using println() to put a value on each line rather than only print()
  • Use theMerge.sort(array)method to sort the values in the array

Use a loop to display each sorted value of the array, labeled as "Merge-sorted array..."

  • Use a row of hyphens "----------------------" to separate the label from output
  • Since doubles can be long, consider using println() to put a value on each line rather than only print()
  • Run the program at least three times, each with a different value for the array length, then copy and paste the results into an output file. See follow-up question for submitting the OUTPUT file.
  • Here is a sample run:
  • java-algs4 aMergeSortDoubles 3
  • Random array...
  • ------
  • 1.2633458343451707
  • 0.4002266109760163
  • 0.1365140849236074
  • Merge-sorted array...
  • ------
  • 0.1365140849236074
  • 0.4002266109760163
  • 1.2633458343451707




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

Starting Out With Python Global Edition

Authors: Tony Gaddis

4th Edition

1292225750, 9781292225753

More Books

Students also viewed these Programming questions

Question

Find an equation of the given line. Slope is -2; x-intercept is -2

Answered: 1 week ago

Question

What statement do you have to have in a value-returning function?

Answered: 1 week ago

Question

What are the pieces of data that are passed into a function called?

Answered: 1 week ago