Write a method in your ArrayUtilities class that meets the following requirements: - It should be named "fill". - It should declare parameters for an int array, an int value, an int index, and an int times. - It should copy the value into the array beginning at the index the specified number of times. The modifications to the array should be done in place. - It should not return anything. For example, given: array = [0,0,0,0,0,0] value = 5 index = 2 times = 3 When the method is finished, the array should contain [0,0,5,5,5,0]. To be clear the value 5 was copied into the array 3 times beginning at index 2. Modify your main method to demonstrate that your function works.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question
100%
Write a method in your ArrayUtilities class that meets the following
requirements:
- It should be named "fill".
- It should declare parameters for an int array, an int value, an int index,
and an int times.
- It should copy the value into the array beginning at the index the specified
number of times. The modifications to the array should be done in place.
- It should not return anything.
For example, given:
array = [0,0,0,0,0,0]
value = 5
index = 2
times = 3
When the method is finished, the array should contain [0,0,5,5,5,0]. To be
clear the value 5 was copied into the array 3 times beginning at index 2.
Modify your main method to demonstrate that your function works.
Transcribed Image Text:Write a method in your ArrayUtilities class that meets the following requirements: - It should be named "fill". - It should declare parameters for an int array, an int value, an int index, and an int times. - It should copy the value into the array beginning at the index the specified number of times. The modifications to the array should be done in place. - It should not return anything. For example, given: array = [0,0,0,0,0,0] value = 5 index = 2 times = 3 When the method is finished, the array should contain [0,0,5,5,5,0]. To be clear the value 5 was copied into the array 3 times beginning at index 2. Modify your main method to demonstrate that your function works.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT