Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given two equal - sized one - dimensional arrays a and b , calculate the followings: multiply the two arrays element - wise add the
Given two equalsized onedimensional arrays a and b calculate the followings:
multiply the two arrays elementwise
add the first element of a and the last element of b
divid evenindexed elements of a by evenindexed elements of b
Each of the above calculations should become an output value of your function.
Here are some concrete examples of what is expected:
given a and b the output of the function should be ; ;
given a and b the output of the function should be ; ;
Note that the grader generates random assessment cases and above example is not the only assessment cases. You should utilize 'Code to Call Your Function' script box and thoroughly test your function with more input arguments before making a submission.
Task
Write a function elementwisearithmetic that takes two inputs arguments and returns three output values. The input arrays will not be empty and always be equal in the number of elements, so you don't need to worry about that.
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