ENGR 103 Assignment 4: Array Manipulation

Verified

Added on  2019/09/18

|1
|258
|937
Homework Assignment
AI Summary
This is a homework assignment for ENGR 103 at SFSU, focusing on C programming and array manipulation. The assignment requires students to write a C program that reads a 2D array, copies its elements into a single array row-wise and column-wise, and calculates new array values using a given polynomial function. The program should also display the original and calculated matrices with proper formatting. Extra credit is given for using external files for input and output. The assignment includes functions for copying rows (COPYR), copying columns (COPYC), and polynomial calculation (POLYNOMIAL), along with a specified polynomial function (POLY(X)).
Document Page
Engr 103 SFSU Fall 2016
A. Tabrizi School of Engineering All Sections
Assignment NO 4
Write a C program to read in a 2-dimestional arrays and store this array in
ARY whose dimensions M and N are read in.
A) Write a function called COPYR that will copy all the elements of the
given double array ARY row by row to a single array called VCTR
B) Write a function called COPYC that will copy all the elements of the
Given double array ARY column by column to a single array called
VCTC
C) Write a function called POLYNOMIAL that will calculate all the
elements of the double array ARY one by one with the given
polynomial function called POLY. You will store the new double
array values to CALCULATED double arrays.
POLY(X) = 2X3 + 5X2 + 3Sin(X) – 4COS(X)
The double array ARY given as:
2.1 3.5 1.1 5.5
ARY = 0.5 3.5 4.6 0.75
5.3 0.95 0.3 1.2
Note:
a) Draw the flow chart.
b) Display the given matrix and calculated matrix and arrays with a
proper formatting.
Extra Credit
1) for extra credit, use external file(s) to input all the given data.
2) Not only you display the interactive output (Part b), your output
should be copied to an external file.
3) Display all the external file(s).
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser