Question: Write comments in your programs. Programs with no comments will receive PARTIAL credits. For each program, the following info should at least be included

Write comments in your programs. Programs with no comments will receive PARTIAL credits. For each program,Your C program must include at least the following user defined functions: //find_magnitude accepts threeSample code execution 1: Bold entered by a user 3-D Vector calculation Enter M or m to find the magnitude

Write comments in your programs. Programs with no comments will receive PARTIAL credits. For each program, the following info should at least be included at the top of the C file: Author and Date created: Brief description of the program: input(s) and output(s): an algorithm (or description/relationship between inputs and outputs) Homework 5 Problem 2 (35 points): Three-dimensional vector calculation Given a vector V = , its magnitude is calculated as |V| = |V + V + V2 Z Given two vectors V1 = and V2 = , the dot product is V1. V2 = V1 dot V2 = Vx1* Vx2 + Vy1* Vy2 + Vz1* Vz2 the angle (in degrees) between the two vectors is V1.V2 180 .-1 0 = cos ;) |V1|*|V2|. Use 3.14159 for TT. Write an interactive C program that * T display options for vector calculation that a user can choose ask a user for an option (M/m for finding the magnitude, D/d for finding the dot product and angle between the two vectors, Q/q to Quit) ask a user for one vector or two vectors (depending on the option) find and display the calculation Your C program must include at least the following user defined functions: //find_magnitude accepts three input arguments and returns the vector magnitude double find_magnitude(double Vx, double Vy, double Vz); // find_dotprod_angledeg accepts two vectors and outputs the dot product and angle in degrees between two vectors void find_dotprod_angledeg(double Vx1, double Vy1, double Vz1, double Vx2, double Vy2, double Vz2, double *dotprod, double *angle_deg); Sample code execution 1: Bold entered by a user 3-D Vector calculation Enter M or m to find the magnitude Enter D or d to find the dot product and angle in degrees Enter Q or q to Quit Enter your choice: A wrong option entered 3-D Vector calculation Enter M or m to find the magnitude Enter D or d to find the dot product and angle in degrees Enter Q or q to Quit Enter your choice: M Enter Vx Vy Vz (separated by spaces): 1 2 3.3 magnitude of is 3.9862 3-D Vector calculation Enter M or m to find the magnitude Enter D or d to find the dot product and angle in degrees Enter Q or q to Quit Enter your choice: D Enter VX1 Vy1 Vz1 (separated by spaces): 1 2 3.3 Enter Vx2 Vy2 Vz2 (separated by spaces): 7.1 14.2 23.43 dot is 112.8190 angle between these 2 vectors is 0.0000 degrees 3-D Vector calculation Enter M or m to find the magnitude Enter D or d to find the dot product and angle in degrees Enter Q or q to Quit Enter your choice: m Enter VX Vy Vz (separated by spaces): 7.1 14.2 23.43 magnitude of is 28.3022

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the provided information it appears that you have been tasked with creating an interactive C program that can calculate the magnitude of a ve... View full answer

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 Programming Questions!