Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have a new Java class, LX6. Download the class ArrayManager.java and copy its source code into LX6, changing the class name to LX6 where necessary.

Have a new Java class, LX6. Download the class ArrayManager.java and copy its source code into LX6, changing the class name to LX6 where necessary. Then fill out the method shells in LX6 with the specifications below. After creating the methods below, test them by running the application. The main method allows users to enter a command and, when necessary, additional command specifications.

1) a method displayArray:

  • accepts as a parameter an int array named data
  • prints the array elements to the console, separated by commas and spaces, with the entire array enclosed in braces, e.g., the array [0, 1, 2] should display as {0, 1, 2}

2) a method insertValue:

  • accepts as parameters an int array named data, an int named value, and an int named index
  • creates a new array one element larger than data
  • for every index < index, copies the value from data into the new array
  • copies value into the new array's index element
  • for every index > index, copies the value from data into the new array's next index, i.e., copies from index x in datato index x+1 in the new array
  • returns the new array

3) a method removeValue:

  • accepts as parameters an int array named data and an int named index
  • creates a new array one element smaller than data
  • for every index < index, copies the value from data into the new array
  • for every index > index, copies the value from datainto the new array's previous index, i.e., copies from index x in data to index x-1 in the new array
  • returns the new array

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_2

Step: 3

blur-text-image_3

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

Fixed Income Securities Valuation Risk and Risk Management

Authors: Pietro Veronesi

1st edition

0470109106, 978-0470109106

More Books

Students also viewed these Programming questions

Question

Solve the following the equation. 5(2-c)=10(2c-4)-6(3c+1)

Answered: 1 week ago