Question
Write the program in C++, Input: input a text file input.txt: 20 24 -14 11 39 22 41 45 31 22 33 65 -34 24
Write the program in C++,
Input: input a text file input.txt:
20 24 -14 11 39 22 41 45 31 22 33 65 -34 24 58 53 27 21 -76 32 45 41 29 47 31 13 22 62 -59 64 -78 39 23 -38 52 412 36 -54 28 37 64 -18 -32 43 71 84 63 32 56 -27 37 28 -39 56 41 47 -27 38 25 58 42 53 33 17 21 37 64 -42 39 29 16 47 - 76 -82 28 28 -37 49 -28 93 28 89 47 27 83 37 -29 40 37 49 37 67 -26 12 17 28 93 38 29 39 -136 26 10 20 58 -60 76 -82 61
Output: Write the product matrix out to output.txt file, by appending it to the end;
Problem Description: 1. Open and read the data file, input.txt, which contains some number of integer values (separated by white space character(s)) with the number of integers a multiple of 10. 2. After read the data file your program will process the integer values into two matrixes (stored in two-dimension arrays): the first one with the dimension 5 * X and the second one X * 5, where X is some value determined by the number of integers in the input data file. 3. Output the above two matrixes (in a formatted way) into the output.txt file, 4. Calculate a product matrix (a two-dimension array of long integers) based on the first matrix multiplies the second matrix; 5. Write the product matrix out to the same output.txt file, by appending it to the end;
output.txt:(sample output) ..............
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started