系統(tǒng)級(jí)編程選擇題_第1頁(yè)
系統(tǒng)級(jí)編程選擇題_第2頁(yè)
系統(tǒng)級(jí)編程選擇題_第3頁(yè)
系統(tǒng)級(jí)編程選擇題_第4頁(yè)
系統(tǒng)級(jí)編程選擇題_第5頁(yè)
已閱讀5頁(yè),還剩60頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Multiple Choice Quiz 1分?jǐn)?shù): 1 Consider the following fragment of C+ source code.    String msg; unsigned int x; int y;    cin >> msg >> x >> y;    cout << x + y;   Which of the following is (are) true regarding execution of

2、 the segment?   1. The input statement will always take the same amount of time to execute.   2. The output statement will always be executed immediately after the input statement.   3. If x and y are both positive, an integer greater than both will be printed.選擇一個(gè)答案 a.

3、 II and III only b. none c. I and II only d. II only 正確: BQuestion 2 分?jǐn)?shù): 1 Which of the following does a debugger do?   1. Analyze the source code to find programming errors.   2. Decode machine code generated by a compiler.   3. Stop execution of a program.選擇一個(gè)答案 a. II

4、I only b. I, II, and III. c. I and III only d. II and III only 正確: DQuestion 3 分?jǐn)?shù): 1 Which of the following Visual C+ objects are contained within a "Project"?  I.Files      II.Visual C+ Solutions          III.Flow

5、charts選擇一個(gè)答案 a. I, II and III b. I only c. II only d. II and III only 正確:bQuestion 4 分?jǐn)?shù): 1 Compared to a sequence of machine code instructions, a fragment of C code選擇一個(gè)答案 a. does not engage any transistors during its execution b. is the native way to program most computers c. describes the actions o

6、f the computer, not just of the CPU d. may describe the same algorithm 正確:DQuestion 5 分?jǐn)?shù): 1 Integrated programming environments make it difficult to mix and match tools from different sources. This is選擇一個(gè)答案 a. bad, because all the tools will then have the same user interface b. good, because tools f

7、rom different sources cannot be made to interact with each other c. good, because it ensures compilation is not done incrementally by accident d. bad, because no single vendor is likely to be the source of all the best tools 正確:D這次提交的分?jǐn)?shù):1/1。Question 6 分?jǐn)?shù): 1 When using a debugger to find the cause of

8、 a program's incorrect behavior,選擇一個(gè)答案 a. it is fastest to start by stopping the debugger long before the behavior appears b. the program is usually executed to the point at which the behavior occurs and then executed backwards to find the cause c. it is often necessary to start the program mult

9、iple times under the debugger d. the faulty code fragment must first be identified 正確:C這次提交的分?jǐn)?shù):1/1。Question 7 分?jǐn)?shù): 1 In Visual C+, a Win32 Console Application is選擇一個(gè)答案 a. the status window of the Visual C+ environment b. a program that is able to control the operating system of a windows computer c.

10、built by using sophisticated "Application Wizards" d. the simplest type of application Visual C+ can generate 正確:D這次提交的分?jǐn)?shù):1/1。Question 8 分?jǐn)?shù): 1 Which of the following is able to describe a computation at the highest level of abstraction?  選擇一個(gè)答案 a. machine code b. C code c. C+ cod

11、e d. logic Gates 正確:C這次提交的分?jǐn)?shù):1/1。Multiple Choice Quiz 2 分?jǐn)?shù): 1 Programs compiled for an Intel Pentium processor do not execute properly on a SPARC processor from Sun Microsystems because 選擇一個(gè)答案 a. the memory of a SPARC CPU is numbered from top to bottom b. the operation codes understood by the two pr

12、ocessors are different c. the assembly mnemonics for the same "opcode" are different in the two processors d. copyrights regarding code cannot be violated 正確:B這次提交的分?jǐn)?shù):1/1。Question 2 分?jǐn)?shù): 1 A CPU register is a word of CPU memory that 選擇一個(gè)答案 a. houses a critical variable for the duration of t

13、he execution of a program b. is automatically loaded when a CPU instruction refers to a word of normal memory c. records the results of periodic CPU diagnostics d. is explicitly loaded and unloaded from normal memory by compiler-generated instructions 正確:D這次提交的分?jǐn)?shù):1/1。Question 3 分?jǐn)?shù): 1 A jump instruct

14、ion 選擇一個(gè)答案 a. unconditionally sets the program counter to its operand b. changes a pointer to point to the next element of an array c. increases the program counter d. changes the program counter only if its operand is equal to zero 正確:A這次提交的分?jǐn)?shù):1/1。Question 4 分?jǐn)?shù): 1 11.Which of the following must be

15、true if a program is stopped at a specific line within the Visual C+ debugger? I.There is at least one breakpoint enabled. II.There is a breakpoint enabled on that line. III.There is a breakpoint enabled on the line preceding that line.選擇一個(gè)答案 a. I and III only b. I only c. none d. I and II only 正確:C

16、這次提交的分?jǐn)?shù):1/1。Question 5 分?jǐn)?shù): 1 The program counter contains選擇一個(gè)答案 a. the number of times a program has been executed b. the address of the CPU instruction that is about to be fetched c. the number of CPU instructions a program has executed so far d. the amount of memory a program is currently using 正確

17、:B這次提交的分?jǐn)?shù):1/1。Question 6 分?jǐn)?shù): 1 A branch instruction 選擇一個(gè)答案 a. unconditionally sets the program counter to its operand b. sets the program counter to one of many possible values c. sets the program counter to one of two possible values d. increases the program counter by a fixed amount 正確:C這次提交的分?jǐn)?shù):1/

18、1。Question 7 分?jǐn)?shù): 1 Which of the following are true of the effect that optimizations have on the machine code generated by compilers? I.The resulting code will be faster and/or smaller. II.The resulting code will be clearer. III.The resulting code will be harder to debug. 選擇一個(gè)答案 a. I, II, and III b.

19、I only c. I and II only d. I and III only 正確:D這次提交的分?jǐn)?shù):1/1。Question 8 分?jǐn)?shù): 1 Which of the following computations may be performed by exactly one CPU instruction?1. a = 5;2. a = b + c * 5;3. for (i = 0; i < 10; i += ai+);選擇一個(gè)答案 a. I only b. I and II only c. II only d. I, II, and III 正確:A這次提交的分?jǐn)?shù):1/1。

20、Question 9 分?jǐn)?shù): 1 The machine code generated from source code by a compiler 選擇一個(gè)答案 a. does not preserve all the information given in the source code b. associates variable values with their names c. executes more quickly than the source code d. can be easily inspected to check the correctness of the

21、compiler 正確:A這次提交的分?jǐn)?shù):1/1。Question 10 分?jǐn)?shù): 1 Suppose that, using a tool such as the memory window of Visual C+, we found that a certain set of contiguous memory locations contained the integer 0xC605CD623A8365000000. What could these memory locations hold?1. the integer 0xC605CD623A83650000002. a stri

22、ng3. a CPU instruction選擇一個(gè)答案 a. I and II only b. I only c. III only d. I, II, and III 正確:D這次提交的分?jǐn)?shù):1/1。Question 11 分?jǐn)?shù): 1 Immediately after the CPU executes an instruction that is neither a branch nor a jump instruction, the program counter選擇一個(gè)答案 a. is incremented by one b. remains unchanged c. has a

23、value that cannot be determined without further information d. is incremented to point to the following instruction 正確:D這次提交的分?jǐn)?shù):1/1。Question 12 分?jǐn)?shù): 1 Within Visual C+, which of the following will reveal the value of a variable when the program is stopped at a breakpoint? I.Placing the mouse pointer

24、over the variable name in the source file window. II.Inserting a printf() in the program. III.Typing the variable name on the "Watch" window. 選擇一個(gè)答案 a. III only b. I, II, and III c. I and III only d. II and III only 正確:C這次提交的分?jǐn)?shù):1/1。Question 13 分?jǐn)?shù): 1 Which of the following is a good reason

25、(are good reasons) to equip the CPU with small amounts of fast memory? I.To make the design of the compiler simpler II.To make some CPU instructions smaller III.To make some CPU instructions faster 選擇一個(gè)答案 a. II and III only b. II only c. III only d. I, II, and III 正確:A這次提交的分?jǐn)?shù):1/1。Multiple Choice Qui

26、z 3分?jǐn)?shù): 1/1 In C, using default floating point settings, what happens when a floating-point computation results in an overflow? 選擇一個(gè)答案 a. A special value "infinity" is computed, testable with _finite(). b. Program execution is halted. c. An exception is raised unless disabled by callin

27、g _controlfp(). d. An erroneous value is computed and execution continues. 正確:A這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 2 分?jǐn)?shù): 1/1 Which of the following statements about floating-point numbers in C is true?I. Floating-point numbers are often only approximations of real numbers.II. A 32-bit float only approximates

28、decimal fractions, but a 64-bit double represents them exactly.III. Floating-point numbers can represent any rational real number but not irrationals.選擇一個(gè)答案 a. I and II only b. II only c. I only d. I and III only 正確:C這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 3 分?jǐn)?shù): 1/1 Which of the following could be represented by

29、one bit of information? 選擇一個(gè)答案 a. an ASCII character b. the current channel of a television receiver c. the color of a single pixel on a true-color computer display d. the position of a light switch 正確:D這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 4 分?jǐn)?shù): 1/1 What is the value of the following C expression?0x1234 0

30、x5432選擇一個(gè)答案 a. 0x1030 b. 0x5636 c. 0x4606 d. 0x5434 正確:C(做異或運(yùn)算)這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 5 分?jǐn)?shù): 1/1 What is the purpose of the exponent in floating point numbers? 選擇一個(gè)答案 a. the mantissa is raised to the power of the exponent b. to indicate where the decimal or binary point should be c. to specif

31、y the base as binary, octal, or hexadecimal d. to specify the superscript 正確:B這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 6 分?jǐn)?shù): 1/1 How is -10 (decimal) represented in an 8-bit 2's complement binary format? 選擇一個(gè)答案 a. 11110110 b. 11110101 c. 11111010 d. 10001010 正確:A(取反加一)這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 7 分?jǐn)?shù): 1/1 Which

32、of the following numerical operations is most likely to lead to loss of precision? 選擇一個(gè)答案 a. Integer addition b. Integer multiplication c. Floating-point addition d. Floating-point multiplication 正確:C這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 8 分?jǐn)?shù): 1/1 In C, what is the following binary number in hexadecimal?11

33、010101選擇一個(gè)答案 a. 0xB5 b. 0xD5 c. 0xAB d. 0x5D 正確:B這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 9 分?jǐn)?shù): 1/1 In a computer with 4-byte words, which of the following C expressions tests whether ptr contains the address of a word?I. (ptr & 3) = 0II. (ptr | 3) = 0III. (ptr % 4) = 0選擇一個(gè)答案 a. II only b. I and III only c. II

34、I only d. I only 正確:B這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 10 分?jǐn)?shù): 1/1 What is the value of the following C expression?0x1234 & 0x5432選擇一個(gè)答案 a. 0x1030 b. 0x1111 c. 0x5636 d. 0x6666 正確:A(與運(yùn)算)這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 11 分?jǐn)?shù): 1/1 How is 46 (decimal) represented in an 8-bit 2's complement binary format?選擇一個(gè)答

35、案 a. 00101110 b. 00011110 c. 00101100 d. 01000110 正確:A(正數(shù)的補(bǔ)碼是它本身)這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 12 分?jǐn)?shù): 1/1 What happens in a C program when an addition would cause integer overflow? 選擇一個(gè)答案 a. An incorrect result is produced and execution continues. b. Execution is terminated. c. The correct value is

36、 coerced to a floating point number. d. An exception-handler is called with the two operands as parameters. 正確:A這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Multiple Choice Quiz 41 分?jǐn)?shù): 1/1 In one computer, the bytes with addresses A, A+1, A+2 and A+3 contain the integer 256, and the variable declared with int * a; has the valu

37、e A. In a different computer, the bytes with addresses B, B+1, B+2 and B+3 also contain the integer 256, and the variable declared with int * b has the value B. Which of the following are necessarily true? 1. The contents of A+1 are equal to the contents of B+1. 2. The contents of A+1 are equal to t

38、he contents of B+2. 3. *a = *b 選擇一個(gè)答案 a. I and III only b. II and III only c. I only d. III only 正確:D這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 2 分?jǐn)?shù): 1/1 Given the following declaration and initialization of s, what is the value of the expression s6?char s = "string" 選擇一個(gè)答案 a. 'n' b. 'g' c.

39、 an unpredictable value d. '0' 正確:D這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 3 分?jǐn)?shù): 1/1 The Visual C+ Memory window displays 選擇一個(gè)答案 a. the names and values of variables in memory, interpreted as 32-bit integers no matter what the variables' types b. the names and values of variables in memory, interprete

40、d in one of several ways c. the contents of memory, interpreted as 32-bit integers, without the associated variable names d. the contents of memory, interpreted in one of several ways, without the associated variable names 正確:D這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 4 分?jǐn)?shù): 1/1 In C, assuming that an int takes 4 by

41、tes, how many bytes are required to represent the following array?int a12; 選擇一個(gè)答案 a. 12 b. 52 c. 44 d. 48 正確:D這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 5 分?jǐn)?shù): 1/1 Which of the following statements about alignment within C struct's is true?1. Alignment may cause the allocation of unused space.2. Alignment is requ

42、ired by all modern processors.3. Alignment can help processors access data more efficiently.選擇一個(gè)答案 a. I, II, and III b. II and III only c. I only d. I and III only 正確:D這次提交的分?jǐn)?shù):1/1。回復(fù)歷史:Question 6 分?jǐn)?shù): 1/1 Given the address of a C struct at runtime, how is the address of a member element in the struct

43、 determined? 選擇一個(gè)答案 a. A constant offset associated with the member is added to the address. b. A linear search is made from the base address of the struct. c. The struct consists of an array of pointers to the elements of the struct. d. The element name is looked up in a symbol table. 正確:A這次提交的分?jǐn)?shù):1

44、/1?;貜?fù)歷史:Question 7 分?jǐn)?shù): 1/1 Consider the following code.char a100;a99 = *(char *) (int) &a0) + 4)If integers are 32 bits wide, which of the following values is equal to a99?選擇一個(gè)答案 a. the integer stored in the bytes a4, a5, a6 and a7 b. a4 c. a0 + 4 d. a3 正確:B這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 8 分?jǐn)?shù): 1/1 In

45、 C, assuming that an int takes 4 bytes, if array a is declared as follows and a has the value 0x10000, what is the value of the expression a + 2?int a12; 選擇一個(gè)答案 a. 8 plus the contents of location 0x10000 b. 0x10004 c. 0x10002 d. 0x10008 正確:D這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 9 分?jǐn)?shù): 1/1 We want the variable fa

46、ctorialfunc to hold the address of the first instruction of the following function:int factorial(int n) if (n = 1) return n;return n * factorial(n -1);How would we declare the variable? 選擇一個(gè)答案 a. we can't: C cannot extract the addresses of instructions. b. int (int) * factorialfunc c. int (*fact

47、orialfunc)(int); d. factorial() * factorialfunc; 正確:C(定義一個(gè)函數(shù)指針)這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 10 分?jǐn)?shù): 1/1 Consider the following code a;int b;int main(int argc, char *argv) int c;int d;./* some code */Which of the following must be true?選擇一個(gè)答案 a. The values of &a and &b are closer to

48、each other than the values of &c and &d. b. The values of *a and *b are closer to each other than the values of *c and *d. c. The value of &d is closer to the value of &c than to the value of &a. d. The value of *d is closer to the value of *c than to the value of *a. 正確:C這次提交的分?jǐn)?shù)

49、:1/1?;貜?fù)歷史:Multiple Choice Quiz 51 分?jǐn)?shù): 1/1 Consider the following segment of C source code. int a = 8;int b = *&a;What is the value of variable b at the end of execution of the segment? 選擇一個(gè)答案 a. (int) &a b. (int) &b c. a d. &a 正確:C這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 2 分?jǐn)?shù): 1/1 At which of the f

50、ollowing times is an activation record created?  I.When a program starts executing.  II.Every time a function is invoked. III.When a variable is declared. 選擇一個(gè)答案 a. II and III only b. II only c. III only d. I and II only 正確:D這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 3 分?jǐn)?shù): 1/1 Consider the progra

51、m given below.    #include     int callee(void)         int count = 5;        printf("%d ", (int) &count);        return count;     

52、;   int main (int argc, char *argv)         int count = 4;        count = callee();        printf("%d ", (int) &count);         

53、60; return 0;    Which of the following describes the output of the program?  選擇一個(gè)答案 a. Two different integers are printed, and the value of neither can be determined from the information given. b. 5 and 4 are printed, in that order on the same line. c. 5 is printed twice on

54、 the same line. d. One integer is printed twice, and its value cannot be determined from the information given. 正確:A這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 4 分?jǐn)?shù): 1/1 Consider the following function.    int factorial(int n)         if (n = 1) return n;  &

55、#160;     return n * factorial(n - 1);    How many activation records are "popped" when it is invoked by the expression factorial(4)?  選擇一個(gè)答案 a. 1 b. 0 c. 5 d. 4 正確:D這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 5 分?jǐn)?shù): 1/1 In one computer, the bytes with addresses A

56、, A+1, A+2 and A+3 contain the integer 256, and the variable declared with int * a; has the value A. In a different computer, the bytes with addresses B, B+1, B+2 and B+3 also contain the integer 256, and the variable declared with int * b has the value B.  In a computer in which both addresses and integers are 32 bits wide, how many bytes of memory will the compiler allocate for following code fragment? int a;int * b = &a; 選擇一個(gè)答案 a. 8 b. 0 c. 4 d. 32 正確:A這次提交的分?jǐn)?shù):1/1?;貜?fù)歷史:Question 6 分?jǐn)?shù): 1/1 What is printed as a result of execution of the following program?  

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論