Home / Expert Answers / Computer Science / 1-write-a-simple-keep-it-as-simple-as-possible-program-in-nbsp-c-nbsp-to-read-in-a-list-of-inte-pa535

(Solved): (1)Write a SIMPLE (KEEP IT as SIMPLE as possible) program in C++ to read in a list of inte ...



(1)Write a SIMPLE (KEEP IT as SIMPLE as possible) program in C++ to read in a list of integers from a file. The integers will be placed into a two-dimensional array that has 5 rows and 8 columns.

(2) The file has 40 values so each value will have a place in the array.

(3) Once the values have been placed, main will have to print the complete table (in tabular form, with rows and columns and USING SETW() to format the values).

(4) The table has to include the row total at the end of each row and the column total at the end of each column.

(3) Then, PRINT THE TOTAL OF BOTH ROWS AND COLUMNS  (see attached below)

Note:

- The file name as a constant string, as in: const string FILENAME = "value.dat";

- only #include <iostream> , <fstream>, and <iomanip>

- This program will have 4 nested loop: 1 to read file, 1 print row, 1 to print column and 1 to print the total

- Remember to USE SETW() to format the values (3)

What the text file will look like:

\( \begin{array}{rrrrrrrrr}56 & 123 & 4 & 17 & 23 & 89 & 145 & 234 & 691 \\ 45 & 8 & 3 & 7 & 90 & 88 & 12 & 5 & 258 \\ 6 & 10

\( \begin{array}{rrrrrrrrr}56 & 123 & 4 & 17 & 23 & 89 & 145 & 234 & 691 \\ 45 & 8 & 3 & 7 & 90 & 88 & 12 & 5 & 258 \\ 6 & 10 & 25 & 67 & 32 & 54 & 1 & 0 & 195 \\ 65 & 64 & 77 & 22 & 11 & 66 & 55 & 44 & 404 \\ 33 & 85 & 84 & 73 & 72 & 52 & 53 & 23 & 475 \\ 205 & 290 & 193 & 186 & 228 & 349 & 266 & 306 & \end{array} \)


We have an Answer from Expert

View Expert Answer

Expert Answer


The given question is solved using C++ language. The file s
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe