Question: A Write the C++ code of a function that takes as inputs, a number, position, and digit. The function should return a new number with
A Write the C++ code of a function that takes as inputs, a number, position, and digit. The function should return a new number with the digit at position 'position' changed to 'digit'. Start counting the digits from the left means left most digit will be at position zero. For example:
number = 127856, position = 3, digit = 9: the function returns 127956 number = 2431, position = 0, digit = 5: the function returns
B Write C++ code of a function named dot_Product( ) that returns either the product of two numbers x1 and y1 or the dot product of a pair of two-dimensional vectors (x1, y1) and (x2, y2) or the dot product of a pair of three-dimensional vectors (x1, y1, z1) and (x2, y2, z2), according to whether the function is passed 2, 4, or 6 parameters. For example, with four arguments (3.0, 8.0, -4. 0, 6.0), the call dot_Product would return (3.0) (-4.0) + (8.0) (6.0) = 36.0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
