Lab Exercise. -2-D Arrays in C++` In this lab exercise, you are required to write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Lab Exercise. -2-D Arrays in C++` In this lab exercise, you are required to write a C++ program to add two 4 * 5 matrices and then output the results to the screen. Prompt the user to enter the name of two files with matrices Compute the sum of the two matrices and output the results A sample run is as follows: Please enter the name of the file containing data for Array 1: input1.txt Please enter the name of the file containing data for Array 2: input2.txt The sum is: - 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 . Further requirements: o Create three functions: readArray printArray with void return and one 2D array argument with void return and three 2D array arguments with void return and one 2D array argument and one string argument sumArray o Separate your code into three files as described in the lab: H main.cpp myFunction.cpp myFunction.h o Remember, you will have to break the compiling into three steps now: a. g++ -c main.cpp b. g++ -c my Function.cpp C. g++ main.o my Function.o -o main o The two input files are available by clicking: input1.txt and input2.txt Lab Exercise. -2-D Arrays in C++` In this lab exercise, you are required to write a C++ program to add two 4 * 5 matrices and then output the results to the screen. Prompt the user to enter the name of two files with matrices Compute the sum of the two matrices and output the results A sample run is as follows: Please enter the name of the file containing data for Array 1: input1.txt Please enter the name of the file containing data for Array 2: input2.txt The sum is: - 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 . Further requirements: o Create three functions: readArray printArray with void return and one 2D array argument with void return and three 2D array arguments with void return and one 2D array argument and one string argument sumArray o Separate your code into three files as described in the lab: H main.cpp myFunction.cpp myFunction.h o Remember, you will have to break the compiling into three steps now: a. g++ -c main.cpp b. g++ -c my Function.cpp C. g++ main.o my Function.o -o main o The two input files are available by clicking: input1.txt and input2.txt Lab Exercise. -2-D Arrays in C++` In this lab exercise, you are required to write a C++ program to add two 4 * 5 matrices and then output the results to the screen. Prompt the user to enter the name of two files with matrices Compute the sum of the two matrices and output the results A sample run is as follows: Please enter the name of the file containing data for Array 1: input1.txt Please enter the name of the file containing data for Array 2: input2.txt The sum is: - 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 . Further requirements: o Create three functions: readArray printArray with void return and one 2D array argument with void return and three 2D array arguments with void return and one 2D array argument and one string argument sumArray o Separate your code into three files as described in the lab: H main.cpp myFunction.cpp myFunction.h o Remember, you will have to break the compiling into three steps now: a. g++ -c main.cpp b. g++ -c my Function.cpp C. g++ main.o my Function.o -o main o The two input files are available by clicking: input1.txt and input2.txt
Expert Answer:
Answer rating: 100% (QA)
The task in the image is to create a C program that adds two 4x5 matrices and then outputs the results to the screen The program should also prompt th... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Solve each equation. a. x = x b. x(x 8) = 4(x - 9) -
-
Record the following process costing transactions in the general journal: a. Purchase of raw materials on account, $9,900 b. Requisition of direct materials to: Assembly Department, $4,500 Finishing...
-
Sidney took a $200 cash advance by using checks linked to her credit card account. The bank charges a 2 percent cash advance fee on the amount borrowed and offers no grace period on cash advances....
-
Nereus Montemayor was an employee of VZ Hogs, a company that raises hogs and produces hog feed. VZ Hogs used an extruder manufactured by Sebright Products, Inc. to create hog feed out of discarded...
-
Selected accounts from Dences Gourmet Shops adjusted trial balance as of March 31, 2014, the end of the current fiscal year, follow. The merchandise inventory for Dences was $81,222 at the beginning...
-
Jane has been offered a research consultancy job to study the impact of inequality of poverty in five SADC countries of her choice. As her former classmate, Jane has asked you to help advise her on...
-
Calculate gross pay for each of the following employees of Launchpad Co. The company offers a regular wage rate of $8.20/hour to all employees. Under an incentive plan in place for all employees,...
-
6. If a taxpayer files a proper request for an extension, what action still must be made by the taxpayer? 7. What is the general rule for the statute of limitations for the IRS to assess additional...
-
Macy's, Inc.'s consolidated December 30, 2000 balance sheet lists the following liabilities: accounts payable, $14,840; accrued liabilities, $39,942; and debt of $44,000. All of the accounts payable...
-
Method: Genetic Algorithm Objective Function: f(x1, x2, ...,xn) = xi n 2 i-1 (minimization) Maximum Number of Objective Function Evaluations: 10,000 Population Size: 20 Problem Dimension: 5 Each...
-
What is the molecular machinery and regulatory networks underlying carbon fixation pathways in photosynthesis, particularly focusing on the Calvin cycle and alternative carbon fixation mechanisms,...
-
On February 8, 2023, Virginian Enterprises received a $14,500 bill from Livingstone Landscaping for landscaping work performed on February 4. Virginian Enterprises paid $5,000 on February 10, 2023,...
-
} 8.5-20 Points Student func() { unique_ptr arr[] { }; make_unique ("CSC340") // #1 Insert Code int main() { // #2 Insert Code } [#1 Insert Code]: Write code to keep all the object(s) which...
-
Zephyr owned a rental house in Folsom that had fair market value of $500,000. Zephyr's adjusted basis in the house was $261,498. This year, Zephyr exchanged his Folsom rental house with Isabella for...
-
What are the typical record-at-a-time operations for accessing a file? Which of these depend on the current file record?
-
While preparing Massie Miller's 2012 Schedule A, you review the following list of possible charitable deductions provided by Massie: Cash contribution to a family whose house burned...
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
How are qualified dividends taxed in 2012? Please give the two rates of tax which apply to qualified dividends, and specify when each of these rates applies._________________________...
-
Repeat problem 44 for the truss on the right side of the figure. The properties of element 6 are same as those of element 5 , but T = 0 C T = 0 C . Data From Problem 44: The properties of the...
-
The truss shown in the figure supports the force \(F=1,000 \mathrm{~N}\). Both elements have the same axial rigidity of \(A E=10^{7} \mathrm{~N}\), thermal expansion coefficient of \(\alpha=2 \times...
-
Use the finite element method to solve the plane truss shown in problem 29. Assume \(A E=\) \(2 \times 10^{6} \mathrm{~N}, L=1 \mathrm{~m}, \alpha=10 \times 10^{-6} /{ }^{\circ} \mathrm{C}\). The...
Study smarter with the SolutionInn App