Question: Problem: You are to create a program that will read a file to input values into a 2-D array, calculate the sum of each row

Problem: You are to create a program that will read a file to input values into a 2-D array, calculate the sum of each row and store the sums in a 1-D array, then output the sum of each row. The array should contain 12 rows and 6 columns of whole numbers. You should have 4 function total: the main function, the function to read from a file, a function that accepts a 2-D array and stores the sum of each row in a 1-D array, one function to output the elements of the 1- D array. The function to read values from a file should accept a 2-D array, the number of rows and the number of columns for that array. Then store the values from the file in the 2-D array. The values are stored in a file named Lab-9.txt. (Lecture 21 may help) The function to sum the elements of each row should accept the filled 2-D array, the number of rows, the number of columns, and an empty 1-D array (to store the sum). Calculate the sum of each row and store in the 1-D array. (Lecture 21 may help). The function to output the elements of a 1-D array should accept the 1-D array and the number of values stored in the array. Then output the elements of the array one at a time (the cout to output an array element should only contain one array element) to the screen. (You may reuse the function to output elements of the array that you wrote for Lab 8 if you modify it to output to the screen rather than a file). The main function should declare the 2-D array and the 1-D array to hold the sums. Next the main function should call the function to fill the array. Next the main function should call the function to determine the sum of each row. Next the main function should call the function to output the values of the 1-D array which contains the sums of each row.
 Problem: You are to create a program that will read a

Ill AT&T 1 63%.), , 12:56 PM KLab 9 Lab_9-Fal12018.pdf CMPSC 201-Fall 2018 Lab 9 To be done individually Due by the end of your class time on 11/9/18 Think Before Writing Code! We need to see your thought process so we can help you implement it. Make sure that you write your introductory comments and comments for each function (immediately before that function) before asking for help. Goals: Practicing functions using arrays as parameters and processing 2-D array Problem: You are to create a program that will read a file to input values into a 2-D array, calculate the sum of each row and store the sums in a 1-D array, then output the sum of cach row. The array should contain 12 rows and 6 columns of whole numbers. You should have 4 function total: the main function, the function to read from a file, a function that accepts a 2-D array and stores the sum of each row in a 1-D array, one function to output the elements of the 1- D array The fanction to read values from a file should accept a 2-D array, the number of rows and the number of columns for that array. Then store the values from the file in the 2-D aray. The values are stored in a file named "Lab-9t. (Lecture 21 may help) The function to sum the elements of each row should accept the filled 2 rows, the number of columns, and an empty 1-D array (to store the sum). Calculate the sum of each row and store in the 1-D array. (Lecture 21 may help). -D array, the number of The function to output the elements of a 1-D aray should accept the 1-D array and the number of values stored in the array. Then output the elements of the array one at a time (the cout to output an array element should only contain one array clement) to the screen. (You may reuse the function to output elements of the array that you wrote for Lab 8 if you modify it to output to the screen rather than a file). The main function should declare the 2-D array and the 1-D array to hold the sums Next the main function should call the function to fill the array. Next the main function should call the function to determine the sum of each row, Next the main function should call the function to output the values of the 1-D array which contains the sums of each row Remember that your function definitions should appear after main and your program should contain the usual introductory comments at the beginning of the file plus comments specific to each function immediately before that function. The function comments should contain the purpose of the function, input needed (passed to the function and or interactive input within the function), output from the function (returned back to the function call and/or output to screen), and processing (how to get the output from the imput) Lab 8 CIPSC 201-Fall 2018 20 Dashboard Calendar To Do Notifications Inbox

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!