Write a function that reverses a character string for


C++ Programming

1. Write a function double replace_if_greater(double* p, double x) that replaces the value to which p points with x if x is greater. Return the old value to which p pointed.

2. Write a function that computes the average value of an array of floating-point data, using a pointer variable, not an integer index, to traverse the array elements.

double average (double* a, int size)

3 Write a function that reverses a character string. For example "Harry" becomes "yrraH".

void reverse(char s[])

You must write a program that tests both functions.

You must comment your code including comments at the beginning of each function that explains what the program does and comments for every line of code that explains what is happening for the line of code. Apply troubleshooting and testing strategies to ensure your code compiles, runs, and provides accurate results.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a function that reverses a character string for
Reference No:- TGS02166336

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)