- Create A Program That Asks The User For The X And Y Components Of A 2 Tuple Vector The Program Must Then Output The Vec 1 (131.66 KiB) Viewed 55 times
Create a program that asks the user for the x and y components of a 2-tuple vector. The program must then output the vec
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Create a program that asks the user for the x and y components of a 2-tuple vector. The program must then output the vec
Create a program that asks the user for the x and y components of a 2-tuple vector. The program must then output the vector in the vector-notation-style, as shown on line 4 of the example output (by calling the print_vector function). The program must then compute the magnitude of this vector as shown on line 6 of the example output (by calling the print_magnitude function). Ensure all real numbers output are displaying to three decimal places. Remember, for a 2-tuple vector, the magnitude of vector v, (written as |v|) is computed as follows: 2 2 |v| = [vx² + vy² Declare, define, and from main call, the following modular functions (each must be free of side- effects such as unnecessary printing or scanning) - use the following prototypes: void print _vector (float vx, float vy); float compute_magnitude (float vx, float vy); void print_magnitude (float vx, float vy); When run, the program's console output must be in the following style: 1 x? 3 2 y? 4 3 4 Vector = <3.000, 4.000 > 5 63.000, 4.000 >| = 5.000