Question: CSCI 40 /ENGR 40 ASSIGNMENT ONE-DIMENSIONAL ARRAYS AS FUNCTION ARGUMENTS Write a function called bias that has three arguments: x - an input array of

 CSCI 40 /ENGR 40 ASSIGNMENT ONE-DIMENSIONAL ARRAYS AS FUNCTION ARGUMENTS Write

CSCI 40 /ENGR 40 ASSIGNMENT ONE-DIMENSIONAL ARRAYS AS FUNCTION ARGUMENTS Write a function called bias that has three arguments: x - an input array of floating-point values, y - an empty output array of the same size as x, and n - an integer that specifies the number of elements in arrays x and y. The function bias shoul the x array values with the minimum value of the x array subtracted from each one. For example, if d fill the y array with 10 2 36 8 3 y= [8101341611 Thus the minimum value of the y array will always be zero. (This operation is referred to as removing the bias in array x). To get the minimum of the x array when needed in the bias function, call a function named min from within the function bias. (You will therefore need to write the function min as well, but we already did this in class). To test your functions write a driver main program that does the following: 1. Establishes the size of arrays x and y at 20. 2. Loads array x from the keyboard. 3. Calls bias to fill the y array 4. Prints out the contents of arrays x and y side by side. Turn in the source code for your main program and the functions bias and min. Include output from two runs (one where the minimum value of the x array is positive and one where the minimum value is negative)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!