Question: I need a full C++ code based on this pseudocode, thank you. 1. START 2. Vector 3. x 4. y 5. END Vector 6. get

I need a full C++ code based on this pseudocode, thank you.

I need a full C++ code based on this pseudocode, thank you.1. START 2. Vector 3. x 4. y 5. END Vector 6.

1. START 2. Vector 3. x 4. y 5. END Vector 6. get vector(parameters: pointer to name, pointer to v) 7. START 8. Prompt the user to enter the name of the vector 9. Set name to the user's name input 10. Prompt the user to enter the x value of the vector 11. Set x of v to the user's x value input 12. Prompt the user to enter the y value of the vector 13. Set y of v to the user's y value input 14. END 15. calc, sum(parameters: vec1, vec2, pointer to sum) 16. START 17. Set x of sum to the sum of veci's x and vec2's x 18. Set y of sum to the sum of vect's y and vec2's y 19. END 20. calc differ(parameters: vec1, vec2, pointer to differ) 21. START 22. Set x of differ to the difference of veci's x and vec2's x 23. Set y of differ to the difference of vect's y and vec2's y 24. END 25. scalar, mult(parameters: vec1, k, pointer to s mult) 26. START 27. Set x of smult to the product of vect's x and k 28. Set y of mult to the product of veci's_y and k 29. END 30. scalar prod(parameters: vec1, vec2) 31. START 32. Return the sum of the product of vec1's x and vec2's x and the product of vect's y and vec2's y 33. END 34. magnitude(parameters: vec1) 35. START 36. Return the square root of the sum of vect's x squared and veci's y squared 37. END 38. START 39. Initialize name1 to empty string 40. Initialize name 2 to empty string 41. Initialize vec1 to null 49. 42. Initialize vec2 to null 43. Initialize sum to null 44. Initialize differ to null 45. Initialize swmult to null 46. Initialize answer to empty string 47. Initialize choice to null 48. Initialize k to zero Call get vector(name1, vec1) 50. Call get vector(name2, vec2) 51. Do While answer is y or yes 52. Prompt the user to enter an integer on through six of choice 53. Set choice to the user's integer input 54. Case based on choice 55. Case 1 56. Call calc sum(vec1, vec2, sum) 57. Display the sum 58. Case 2 59. Call calc difference veci, vec2, differ) 60. Display the difference 61. Case 3 62. Prompt the user to enter a value for k 63. Call scalar mult(vec1, k, s..mult) 64. Display the scalar multiple 65. Case 4 66. Display the return of value of Call scalar_prod(vec1, vec2) 67. Case 5 68. Display the return value of Call magnitude(vec1) 69. Case 6 70. Call get_vector(name1, vec1) 71. Call get vector(name2, vec2) 72. Default 73. Return -1 74. END CASE 75. Prompt user to enter a value for answer 76. Set answer to the user's input value 77. END do 78. END 1. START 2. Vector 3. x 4. y 5. END Vector 6. get vector(parameters: pointer to name, pointer to v) 7. START 8. Prompt the user to enter the name of the vector 9. Set name to the user's name input 10. Prompt the user to enter the x value of the vector 11. Set x of v to the user's x value input 12. Prompt the user to enter the y value of the vector 13. Set y of v to the user's y value input 14. END 15. calc, sum(parameters: vec1, vec2, pointer to sum) 16. START 17. Set x of sum to the sum of veci's x and vec2's x 18. Set y of sum to the sum of vect's y and vec2's y 19. END 20. calc differ(parameters: vec1, vec2, pointer to differ) 21. START 22. Set x of differ to the difference of veci's x and vec2's x 23. Set y of differ to the difference of vect's y and vec2's y 24. END 25. scalar, mult(parameters: vec1, k, pointer to s mult) 26. START 27. Set x of smult to the product of vect's x and k 28. Set y of mult to the product of veci's_y and k 29. END 30. scalar prod(parameters: vec1, vec2) 31. START 32. Return the sum of the product of vec1's x and vec2's x and the product of vect's y and vec2's y 33. END 34. magnitude(parameters: vec1) 35. START 36. Return the square root of the sum of vect's x squared and veci's y squared 37. END 38. START 39. Initialize name1 to empty string 40. Initialize name 2 to empty string 41. Initialize vec1 to null 49. 42. Initialize vec2 to null 43. Initialize sum to null 44. Initialize differ to null 45. Initialize swmult to null 46. Initialize answer to empty string 47. Initialize choice to null 48. Initialize k to zero Call get vector(name1, vec1) 50. Call get vector(name2, vec2) 51. Do While answer is y or yes 52. Prompt the user to enter an integer on through six of choice 53. Set choice to the user's integer input 54. Case based on choice 55. Case 1 56. Call calc sum(vec1, vec2, sum) 57. Display the sum 58. Case 2 59. Call calc difference veci, vec2, differ) 60. Display the difference 61. Case 3 62. Prompt the user to enter a value for k 63. Call scalar mult(vec1, k, s..mult) 64. Display the scalar multiple 65. Case 4 66. Display the return of value of Call scalar_prod(vec1, vec2) 67. Case 5 68. Display the return value of Call magnitude(vec1) 69. Case 6 70. Call get_vector(name1, vec1) 71. Call get vector(name2, vec2) 72. Default 73. Return -1 74. END CASE 75. Prompt user to enter a value for answer 76. Set answer to the user's input value 77. END do 78. END

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!