Question: The Main function: Write a main that performs that tasks below. A simplifying assumption is that all user inputs are valid and that all the

The Main function:

Write a main that performs that tasks below. A simplifying assumption is that all user inputs are valid and that all the expressions are defined.

1. Your program will prompt the user for the dimension and coordinates of three vectors, say v1, v2, and v3. Your program will then dynamically allocate three arrays to represent the three vectors as three arrays in dimension-coordinates format using these values entered by the user.

2. Your program will then display v1, v2, and v3.

3. Your program will compute and display v1 + v2.

4. Your program will compute and display (v2 + v3) v1 and |v1 v3|.

5. Your program will compute and display v1 v2 and |v2| |v1|.

6. Your program will prompt the user for three 3-dimensional vectors, say v4, v5, and v6. Your program will then display these vectors. Using these vectors, your program will compute and display the remaining vector expressions.

7. Your program will compute and display v4v5 |v1v5| .

8. Your program will compute the unit vector of v4 v5, v\4 v5.

9. Your program will compute and display v4 (v5 + v6).

10. Your program will compute and display (v4 v5) + (v4 v6).

11. Finally, using the equal function, your program will determine whether or not the vectors calculated in 9 and 10 are equal

In C++

The Main function: Write a main that performs that tasks below. A

A typically run of the program would be Listing 1: Code Segment 1 Sample Run: 2 Enter the dimension of three vectors - 4 3 Enter the coordinates of v1 -> 1 2 3 4 4 Enter the coordinates of v24 1 2 3 5 Enter the coordinates of v32 3 4 1 7 v1 = v2 = 9 v3 = 10 12 v1 v2 13 (v2 + v3) * v1 48 14 lv2 - V3! = 3.4641 15 v1*224 and v2 v130 16 17 Enter three 3-D vectors 18 Enter v41 2 3 19 Enter v5-3 1 2 20 Enter v62 3 1 21 22 v4 23 v5 = 24 v6 25 26 (v4 x v5) / (lv4 x v5!) = 27 unit (v4 xv5) = 28 29 v4 x (v5 + v6) = 30 (v4 x v5) + (v4 x v6) 31 v4 x (v5 + v6) and (v4 x v5) (v4 x v6) are equl A typically run of the program would be Listing 1: Code Segment 1 Sample Run: 2 Enter the dimension of three vectors - 4 3 Enter the coordinates of v1 -> 1 2 3 4 4 Enter the coordinates of v24 1 2 3 5 Enter the coordinates of v32 3 4 1 7 v1 = v2 = 9 v3 = 10 12 v1 v2 13 (v2 + v3) * v1 48 14 lv2 - V3! = 3.4641 15 v1*224 and v2 v130 16 17 Enter three 3-D vectors 18 Enter v41 2 3 19 Enter v5-3 1 2 20 Enter v62 3 1 21 22 v4 23 v5 = 24 v6 25 26 (v4 x v5) / (lv4 x v5!) = 27 unit (v4 xv5) = 28 29 v4 x (v5 + v6) = 30 (v4 x v5) + (v4 x v6) 31 v4 x (v5 + v6) and (v4 x v5) (v4 x v6) are equl

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!