Question: ptrfuncs.h : http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrfuncs.cpp ptrfuncs.cpp: http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrfuncs.cpp prtest1.cpp : http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrtest1.cpp prtest2.cpp: http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrtest2.cpp 1. [50 points] Complete ptrfuncs.cpp to implement the first four functions declared in ptrfuncs.h. All

image text in transcribed

image text in transcribed

ptrfuncs.h : http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrfuncs.cpp

ptrfuncs.cpp: http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrfuncs.cpp

prtest1.cpp : http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrtest1.cpp

prtest2.cpp: http://www.cs.ucsb.edu/~mikec/cs16/assignments/pa6/ptrtest2.cpp

1. [50 points] Complete ptrfuncs.cpp to implement the first four functions declared in ptrfuncs.h. All of the functions in ptrfuncs.h involve C++ pointers. Most of them also manipulate a collection of consecutively stored double values - much like a double array. A pointer to the first value provides access Hint/reminder: *p is the same as p[e], and p[i] is the same as *(p i) Begin with this ptrfuncs.cpp skeleton and follow any instructions in that file. For this part, just implement the first four functions double sum (double *values, int n)-find and return the sum of the n values-the pointer holds the address of the first one double *maxPtr (double *values, int n)-find the maximum value, and return a pointer to its address o double "minPtr(double *values, int n) - ditto the minimum value o double valueDiff (double left, double right) find and return the difference between the two double values as left value minus right value Use ptrtest1.cpp to test your implementations. You can compile it and link to your functions, and then run it as follows

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!