SSD6 FInal

April 6, 2018 | Author: Anonymous | Category: Documents
Report this link


Description

View Assessment Result Family Dzhumadillay Name: ev Given Aibe Name: k Logi aybe n: k E- 11386@iitu. mail: kz Statu Enrolle s: d Active Assessment Name: Exam Multiple-Choice Instance: 1 SSD6-17489853_SSD6 Computer Science Section: and Software Engineering - 5B070400CSSE - 0903 K For course: System-Level Programming (SSD6) Corresponding to: SSD6 At: International University of Information Technology (IITU) Your performance was as follows: You took 19 minutes on this assessment from Mon May 16 2011 03:32:57 GMT+0400 to Mon May 16 2011 03:51:24 GMT+0400. Total score: 97.37 1. The program counter contains (a) the amount of memory a program is currently using (b) the number of CPU instructions a program has executed so far (c) the address of the CPU instruction that is about to be executed (d) the number of times a program has been executed Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 1.5.2 of the course notes. Spring During: 2011 Section Status: 2. Consider the following pseudo-instructions. 0x40B7D8 i = i - 1 0x40B7E0 branch-if-not-zero 0x40B7D8 Which of the following code fragments do the instructions encode? I. II. III. if (i != 0) i = i -1; while (--i); do { i = i - 1; } while (i); (a) I only (b) II only (c) III only (d) II and III only Correct answer is (d) Your score on this question is: 2.63 Feedback: See section 1.5.2 of the course notes. 3. Consider the following code. char a[100]; a[99] = *((char *) (((int) &a[0]) + 4)) If integers are 32 bits wide, which of the following values is equal to a[99]? (a) the integer stored in the bytes a[4], a[5], a[6] and a[7] (b) a[0] + 4 (c) a[3] (d) a[4] Correct answer is (d) Your score on this question is: 2.63 Feedback: See section 1.3.5 of the course notes. 4. Consider the following segment of a C program. int i = 99; int a[100]; i = a[i + 1]; Which of the following is true of the segment? (a) When executed, the program will be prematurely terminated by the operating system because of an illegal memory access. (b) Execution will fail because a has the wrong size. (c) i will have the value of the last element of the array a at the end of any execution of the segment. (d) i will have the value 99 at the end of any execution of the segment. Correct answer is (d) Your score on this question is: 2.63 Feedback: See section 1.3.5 of the course notes. 5. Consider the following program. int i; int * jp = &i; int main(int i, char * argv[]) { printf("%d %d\n", (int) &i, (int) jp); } Which of the following describes what it prints? (a) two very different integers (b) two integers that are exactly the same (c) nothing: it will not compile because it is ambiguous (d) two values, one 4 greater than the other Correct answer is (a) Your score on this question is: 0.00 Feedback: See section 1.4.1 of the course notes. 6. Consider the program given below. #include int callee(void) { int count = 5; printf("%d ", (int) &count); return count; } int main (int argc, char *argv[]) { int count = 4; count = callee(); printf("%d ", (int) &count); return 0; } Which of the following describes the output of the program? (a) 5 and 4 are printed, in that order on the same line. (b) Two different integers are printed, and the value of neither can be determined from the information given. (c) One integer is printed twice, and its value cannot be determined from the information given. (d) 5 is printed twice on the same line. Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 1.4.1 of the course notes. 7. In Visual C++, a Win32 Console Application is (a) the status window of the Visual C++ environment (b) the simplest type of application Visual C++ can generate (c) built by using sophisticated "Application Wizards" (d) a program that is able to control the operating system of a windows computer Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 1.2.1 of the course notes. 8. When debugging using Visual C++, which of the following are possible through the Watch window? I. II. III. The program's execution can be stopped. The value of an arbitrary C expression can be calculated. The value of a program variable can be set. (a) II and III only (b) II only (c) III only (d) I, II, and III. Correct answer is (a) Your score on this question is: 2.63 Feedback: See section 1.2.3 of the course notes. 9. Compared to a sequence of machine code instructions, a fragment of C code (a) does not engage any transistors during its execution (b) may describe the same algorithm (c) is the native way to program most computers (d) describes the actions of the computer, not just of the CPU Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 1.1.2 of the course notes. 10. Which of the following does a debugger do? I. II. III. Analyze the source code to find programming errors. Decode machine code generated by a compiler. Stop execution of a program. (a) I, II, and III. (b) III only (c) II and III only (d) I and III only Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 1.1.3 of the course notes. 11. What is the value of the following C expression? 0x1234 & 0x5432 (a) 0x5636 (b) 0x1030 (c) 0x1111 (d) 0x6666 Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 2.1.3 of the course notes. 12. Which of the following explains why it is convenient to use hexadecimal notation when programming? (a) Memory is accessed in 4-bit chunks. (b) Hexadecimal digits line up with bit and byte boundaries. (c) Not all computer numbers can be written in decimal form. (d) Hexadecimal can represent larger numbers than decimal. Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 2.1.2 of the course notes. 13. Which of the following numerical operations is most likely to lead to loss of precision? (a) Integer multiplication (b) Floating-point addition (c) Integer addition (d) Floating-point multiplication Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 2.3.2 of the course notes. 14. Why is the mantissa of a floating point number shifted left as far as possible? (a) to retain as much precision as possible (b) to avoid overflow (c) to align bit positions, simplifying addition (d) to avoid underflow Correct answer is (a) Your score on this question is: 2.63 Feedback: See section 2.3.1 of the course notes. 15. In modern computers, each address represents one _____ of memory. (a) word (b) page (c) byte (d) bit Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 2.2.1 of the course notes. 16. What happens in a C program when an addition would cause integer overflow? (a) The correct value is coerced to a floating point number. (b) An exception-handler is called with the two operands as parameters. (c) An incorrect result is produced and execution continues. (d) Execution is terminated. Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 2.2.2 of the course notes. 17. In C, how is the length of a character string determined? (a) The length is stored in the first 4 bytes; the string characters follow this. (b) The length is predetermined by the compiler. (c) The length is the number of characters preceding a zero. (d) The length is stored in the first byte of the string. Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 2.4.1 of the course notes. 18. Which of the following statements about alignment within C struct's is true? I. II. III. Alignment may cause the allocation of unused space. Alignment is required by all modern processors. Alignment can help processors access data more efficiently. (a) II and III only (b) I, II, and III (c) I only (d) I and III only Correct answer is (d) Your score on this question is: 2.63 Feedback: See section 2.4.3 of the course notes. 19. What is the value of an uninitialized pointer variable declared within a function? (a) the value is undefined (b) its last value from the previous call to the function (c) 0xDEADBEEF (d) 0 (or NULL) Correct answer is (a) Your score on this question is: 2.63 Feedback: See section 3.3.2 of the course notes. 20. A garbage collector (a) frees memory blocks marked as "deleteable". (b) frees memory blocks that cannot be reached by dereferencing pointers. (c) frees all memory blocks that will not be accessed in the future. (d) removes old versions of local variables from the stack . Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 3.3.7 of the course notes. 21. Suppose a compiler uses static storage to store all variables, function parameters, saved registers, and return addresses. Which of the following language features can this compiler support? I. II. III. Local variables. Function calls. Recursion. (a) I only (b) I and II only (c) I, II, and III (d) II only Correct answer is (b) Your score on this question is: 2.63 Feedback: See section 3.1.2 of the course notes. 22. Which of the following features apply to standard heap allocation in C? I. II. III. The size of heap objects must be known at compile time. Heap memory must be explicitly allocated. Heap memory is deallocated when a function returns. (a) I and III. (b) I only. (c) II only. (d) I and II only. Correct answer is (c) Your score on this question is: 2.63 Feedback: See section 3.1.2 of the course notes. 23. Which facts about the cache can be determined by calling the following function? int data[1


Comments

Copyright © 2025 UPDOCS Inc.