Question: C program using reference parameters and arrays as parameters ------------------write a program to read in x, y and z coordinates -for the tips of two

C program using reference parameters and arrays as parameters

------------------write a program to read in x, y and z coordinates

-for the tips of two vectors in 3-space, and store each in a 1-dimensional array

-program should then call two programmer-defined functions, vectorsum and vectordiff

-which will add and subtract the vectors

-Each of these functions has three parameters: an array representing the first vector, array representing the second vector, third array which will hold the vector resulting from the vector arithmetic operation

-------write a third programmer-defined function, vectorminmax

-which will determine the largest and smallest coordinates of the two vectors

-Vectorminmax has four parameters, two arrays representing the vectors, two variables to hold the minimum and maximum coordinate. ( last two are reference parameters)

-main function should read in two vectors; call vectorsum, vectordiff, and vectorminmax; then print out components of the vectors read, the components of the sum and difference vectors, and the minimum and maximum coordinate values.

Post Code please

--------------copy the code and and modify but as a new code so I may see the difference please. The first code functions written that are solved only work for vectors in 3-space

-Make functions more general by modifying them to work for vectors of any positive- dimensional space by adding a parameter that holds the number of dimensions the vectors have

Please post second code so I may see the change please.

Thank you

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!