Page 1 of 1

Consider the following function main const int N COLS = 4; int main() const int N - 20: const int N ROWS 10; int alpha (

Posted: Sat May 14, 2022 3:56 pm
by answerhappygod
Consider The Following Function Main Const Int N Cols 4 Int Main Const Int N 20 Const Int N Rows 10 Int Alpha 1
Consider The Following Function Main Const Int N Cols 4 Int Main Const Int N 20 Const Int N Rows 10 Int Alpha 1 (32.72 KiB) Viewed 47 times
Consider The Following Function Main Const Int N Cols 4 Int Main Const Int N 20 Const Int N Rows 10 Int Alpha 2
Consider The Following Function Main Const Int N Cols 4 Int Main Const Int N 20 Const Int N Rows 10 Int Alpha 2 (40.79 KiB) Viewed 47 times
Consider the following function main const int N COLS = 4; int main() const int N - 20: const int N ROWS 10; int alpha (N): int beta[N]; int matrix (N_ROWS] [N_COLS); return 0; Write a C++ program that tests the function main and the functions discussed in parts 1 through 5. (Add additional functions, such as printing a two-dimensional array, as needed.) 1. Write the definition of the function initAlpha that takes an integer array and its size as parameters. The function should randomly generates 20 numbers between 10 and 87 and stores the numbers. 2. Write the definition of the function doubleAlpha that takes two integer arrays and its size as parameters (Hint: both arrays have the same size). Initializes the elements of beta to two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha.

Consider the following function main const int N COLS = 4; int main() const int N - 20; const int N_ROWS - 10; int alpha[N]; int beta[N]; int matrix(N_ROWS] [N_COLS]; return 0; 1 Write a C++ program that tests the function main and the functions discussed in parts 1 through 5. (Add additional functions, such as printing a two-dimensional array, as needed.) 1. Write the definition of the function initAlpha that takes an integer array and its size as parameters, The function should randomly generates 20 numbers between 10 and 87 and stores the numbers. 2. Write the definition of the function doubleAlpha that takes two integer arrays and its size as parameters (Hint: both arrays have the same size). Initializes the elements of beta to two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha.