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

Given the following statements: unsigned myScores() = {42, 99, 88, 12, 100, 100,

ID: 3807779 • Letter: G

Question

Given the following statements: unsigned myScores() = {42, 99, 88, 12, 100, 100, 0, 98 }; unsigned elements = sizeof(myScores) / sizeof(myScores(0]); which ONE of the following statements in FALSE? a. The compiler will automatically allocate space for 8 array elements, by counting the number of values in the initialization list. b. The value of myScores [0] is 42. c. The value of myScores [elements - 1] is 98. d. The maximum valid index for this array is 7. e. The value of the elements variable is 8. f. Omitting the number of elements between the square brackets is a syntax error in C. g. Both myScores [4] and myScores(5) have the value 100. When we call the fopen function to open a file, the function returns something to us. Which ONE of the following best describes what is returned by the fopen function? a. The value returned is an integer, which is 1 if the function succeeded and something other than 1 if the function failed. b. The value returned is a long integer, which indicates our current position within the file. c. The value returned is a FILE pointer, which we later pass into other file I/O functions to perform operations such as read, write, and close. If the function failed, the value returned is NULL. d. The value returned is always the NULL pointer, which we ran then use when calling other file I/O functions to perform operations such as read, write, and close. e. The value returned is a double, which is the first double in a file containing a sequence of double values. Given a local array defined as double myArray [1000]; and assuming that size of (double) is 8 in our environment, and assuming that the array starts at memory address 20000, which ONE of the following statements is FALSE? a. sizeof(my Array) will have the value 8000. b. Because there is no initialization of the array, the elements of the array will contain whatever happens to be in memory. c. sizeof(myArray(0)) will have the value 8. d. sizeof(myArray) /sizeof (myArray [0]) will have the value 1000. e. The expressions myArray and &myArray;[0] will both have the value 20000. f. The expression myArray [1000] accesses the last valid element of the array.

Explanation / Answer

8)
a. True
b. True
c. True
d. True
e. True
f. False
g. True

9)

a. False
b. False
c. True
d. False
e. False

10)
a. True
b. True (They will contain Grabage values normally )
c. True
d. True
e. True
f. False (It should be myArray[999])

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote