Question: Write a function called read _ vector which inputs from the user a 2 D vector by reading its x - and y - coordinates.

Write a function called read_vector which inputs from the user a 2D vector by reading its x- and y- coordinates. If the user enters zero for BOTH coordinates then repeatedly display the message "Coordinates cannot both be zero." and re-prompt the user. Use the global constant EPSILON to compare these values to zero. Define the function so that it does not return a value and has three input parameters:
Type string that holds the prompt displayed to the user. Define the string as a const parameter and use pass-by-reference. See the lecture notes on how to do this.
Type double that holds the first coordinate of the 2D vector. Define this parameter as pass-by-reference.
Type double that holds the second coordinate of the 2D vector. Define this parameter as pass-by-reference.

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!