Question
Subtraction Given two arrays of integers, you will build an function that will subtract the matching array elements from each other and store that value
Subtraction Given two arrays of integers, you will build an function that will subtract the matching array elements from each other and store that value inside of an array. Once you have done all the subtraction then return the array back to the main method and output it. 1. In your main method, declare and define two arrays of at least 5 integer elements a. Make sure both arrays have the same length. For this one problem, the array should be hard-coded and not from user prompted values b. 2. 3. 4. Create a function that receives both arrays of integers Create a blank array of the same length as the incoming arrays. Create a loop to cycle through the arrays and subtract the array elements and store it inside of an array. a. Remember this loop must work for an array of any size! b. You must NOT hard coding it! This means use the array elements! 5. Once you have cycle through all elements, then return this new array to the main method. Catch it in an array as well. Create a loop that will cycle through all 3 of the arrays to form the final output in the main method. NOT in the custom function. 6. 7. The final output should be in this form. "XYisz a. Where X is the value from the first array b. Y is the value from the second array.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started