Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programming in C, 1-7 Chapter 3 section 3.7, and Chapter 5 section 5.8 of Delore

ID: 3940400 • Letter: P

Question

Programming in C, 1-7

Chapter 3 section 3.7, and Chapter 5 section 5.8 of Delores Etter’s Engineering Problem Solving with C. Answer the questions below in a typed document, numbered appropriately. Thank you!

1) Write a declaration statement for a 1-D array called timedata with a length of n, where n is a pre-declared integer variable. (In other words, n has already been declared in advance.) (Remember, you cannot initialize variable-length arrays in a declaration statement) 2) Write a declaration statement for a 2-D array called wavedata with a width of 2 and a length of 10 3) Write the same declaration, but for a 2-D array with a width of 2 and a length of rn Write the declaration statement for a file pointer to represent wave data, and then write a file assignment statement for that pointer that opens a file, defined as a symbolic constant FILENAME, as a read file. 4)

Explanation / Answer

********Question-1*****   

int n=10;
   int timedata[n];

****************Question-2******

   int wavedata[2][10];
   int wavedata[2][n];

***********Question-3************
   FILE *fin;
char FILENAME[] = "input.txt";

//fin = fopen(FILENAME, mode);

fin = fopen (FILENAME, "r");
******************