Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 readvector which inputs from the user a D 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 reprompt 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 passbyreference. See the lecture notes on how to do this.
Type double that holds the first coordinate of the D vector. Define this parameter as passbyreference.
Type double that holds the second coordinate of the D vector. Define this parameter as passbyreference.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started