Question: Exercise 1. C++ Pass By Reference (a) Write a C++ function to implement a square function that uses references as parameters. This function will accept

Exercise 1. C++ Pass By Reference (a) Write a C++ function to implement a square function that uses references as parameters. This function will accept a double input and square it. Do not use pointers or return variables, but only references. (b) Write a C++ function to implement a square function that uses references as parameters. This function will accept a structure input which has three double members representing x,y,z coordinates of a point, and square of its members element-wise. Do not use pointers or return variables, but only references. (c) Write a C++ program to ask user to input (x,y,z) coordinates of points, and return coordinate-wise square result by calling the functions above. See the sample output below. Your code will be tested against other inputs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
