1. Engineering
  2. Computer Science
  3. please help me with this questions...

Question: please help me with this questions...

Question details
Please help me with this questions
Consider the code at the right, and answer the double myData [16] 0 following three (3) questions. 4. If the data file contains 21 unique double FILE *fp; values, which ONE of the following fp fopen (c: Wdatal file 2.txt, r): statements best describes what will happen if (fp NULL) if fopen succeeded a. Double values will be stored beyond double vala the bounds of the array, leading to undefined behavior. while (fscanf (fp, Elf, sval) 1) b. The while loop will terminate as soon as 16 values have been read my Datatij val: from the file and stored into the array. c. Nothing will be stored into any fclose (fp): element of the array. d. The fiscanf function will fail as soon L as 16 values have been read from the file e. When we compile the source code, the compiler will issue an errorindicating that we are storing beyond the bounds of the array. 5. Assuming that the data file contains only four values 42.2, 1977.7, 7734.40, and 3.14159, in that order, which ONE of the following statements is FALSE? a. myDataloj will contain the value 422. b. myDatal3] will contain the value 3.14159. c. my Data 4) will contain the value 3.14159. d. myData (5) will contain the value 0. e. myData[15] will contain the value 0. f myDatal2] will contain the value 7734.40. 6. If the data file contains between 5 and 16 values, which ONE of the following statements is FALSE? a. Any array elements that are not populated inside the while loop will contain the value 0. b. The value of variable i will contain the number of values successfully stored into the array. c. The next call to fiscanf, after reading the last value from the file, will return a value other than 1 d. Nothing will be stored by the while loop into any element of the array. 7. In a function definition ProcessArray that is designed to receive as an argument the address of the beginning of a two-dimensional array of doubles, with 7 rows and 5 columns, and we need to use array notation inside the function to access array elements, which of the following function prototypes are acceptable to the compiler? Select ALL correct responses. a. void ProcessArray (double arr[7] [5], int rows, int cols) b. void ProcessArray (double arrt 15], int rows, int cols) c. void Process sArray (double arr17] int rows int cols) d. void Process Array (double arrl I], int rows, int cols) e. void Process Array (double arr int rows, int cols)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution