大学英语期末复习TestBank1006.pdf
《大学英语期末复习TestBank1006.pdf》由会员分享,可在线阅读,更多相关《大学英语期末复习TestBank1006.pdf(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Test BankChapter Six (Programming Languages)Multiple Choice Questions1. Which of the following is an example of a language that is based on the functional paradigm? A. LISP B. PROLOG C. C D. C+ ANSWER: A 2. Which of the following is an example of a language that is based on the object-oriented parad
2、igm? A. LISP B. PROLOG C. C D. C+ ANSWER: D 3. Most machine languages are based on the A. Imperative paradigm B. Declarative paradigm C. Functional paradigm D. Object-oriented paradigm ANSWER: A 4. Which of the following is not a type of statement found in a typical high-level imperative programming
3、 language? A. Imperative statement B. Exclamatory statement C. Declarative statement D. Comment statement ANSWER: B 5. Which of the following does not require a Boolean structure? A. If-then-else statement B. While loop statement C. Assignment statement D. For loop statement ANSWER: C 6. Which of th
4、e following is not a control statement? A. If-then-else statement B. While loop statement C. Assignment statement D. For loop statement ANSWER: C 7. Which of the following is not a control statement? A. If-then-else statement B. While loop statement C. Assignment statement D. For loop statement ANSW
5、ER: C 8. Which of the following is not a step in the process of translating a program? A. Executing the program B. Parsing the program C. Lexical analysis D. Code generation ANSWER: A 9. Which of the following is not associated with object-oriented programming? A. Inheritance B. Resolution C. Encaps
6、ulation D. Polymorphism ANSWER: B 10. Which of the following is not associated with the concept of data type? A. Coercion B. Boolean C. Operator precedence D. Strongly typed language ANSWER: C 11. Positions within arrays are identified by means of numbers called A. Indices B. Parameters C. Instance
7、variables D. Constants ANSWER: A 12. Which of the following is ignored by a compiler? A. Control statements B. Declarations of constants C. Procedure headers D. Comment statements ANSWER: D 13. Which of the following is not a possible value of the expression 4 + 6 2 - 1 A. 4 B. 5 C. 6 D. 10 ANSWER:
8、B 14. Which of the following is not a way of referring to a value in a program? A. Variable B. Literal C. Constant D. Type ANSWER: D 15. Which of the following is the scope of a variable? A. The number of characters in the variable s nameB. The portion of the program in which the variable can be acc
9、essed C. The type associated with the variable D. The structure associated with the variable ANSWER: B 16. Which of the following is a means of nullifying conflicts among data types? A. Inheritance B. Parsing C. Coercion D. Code optimization ANSWER: C 17. Which of the following is not constructed by
10、 a typical compiler? A. Source code B. Symbol table C. Parse tree D. Object program ANSWER: A 18. Which of the following is a means of defining similar yet different classes in an object-oriented program? A. Inheritance B. Parsing C. Coercion D. Code optimization ANSWER: A 19. Which of the following
11、 is not a parse tree of an expression based on the following grammar? A. B. C. ANSWER: C 20. Which of the following statements is not a resolvent of the following clauses? P OR Q OR R P OR T Q OR T R OR T A. Q OR R OR T B. T OR P C. P OR R OR T D. Q OR T ANSWER: B 21. Which of the following can Prol
12、og conclude from the following program? parent(jill, sue). parent(jill, sally). parent(john, sue). parent(john, sally). sibling(X, Y) :- parent(Z, X), parent(Z, Y).A. parent(jill, john)B. sister(sue, sally)C. sibling(sue, sally)D. sibling(jill, sue) ANSWER: C Fill-in-the-blank/Short-answer Questions
13、1. In contrast to _ languages such as English and Spanish, programming languages are considered _ languages and are rigorously defined by their grammars. ANSWER: natural, formal 2. List two disadvantages of both machine languages and assembly languages that are overcome by high-level programming lan
14、guages. _ _ ANSWER: They are machine dependent and they require that algorithms be expressed in small machine-related steps rather that larger application-oriented steps. 3. Indicate how each of the following types of programming languages is classified in terms of generation (first generation, seco
15、nd generation, or third generation). A. High-level languages _ B. Machine languages _ C. Assembly languages _ ANSWER: A. Third generation B. First generation C. Second generation 4. List four data types that occur as primitive types in many high-level programming languages. _ _ _ _ ANSWER: Possible
16、answers include: integer, real (or float), Boolean, and character. 5. What encoding system is commonly used to encode data of each of the following types? A. Integer _ B. Real _ C. Character _ ANSWER: (CAUTION: This question relies on material from chapter 1) A. Two s complementB. Floating-point C.
17、ASCII or Unicode 6. A _ array is an array in which all entries are of the same type whereas entries in a _ array may be of different types. ANSWER: homogeneous, heterogeneous 7. In programming languages that use + to mean concatenation of character strings, the expression “2x” + “3x”will produce wha
18、t result? _ ANSWER: “ 2x3x ”8. Rewrite the following instructions using a single if-then-else statement. if (X = 5) goto 50 goto 60 50 print the value of Z goto 100 60 print the value of Y 100 . . . ANSWER: if (X = 5) then (print the value of Z) else (print the value of Y)9. The following is a progr
19、am segment and the definition of a procedure named sub. . . X 3; procedure sub (Y) sub (X); Y 5; print the value of X; . . A. What value will be printed by the program segment if parameters are passed by value? _ B. What value will be printed by the program segment if parameters are passed by refere
20、nce? _ ANSWER: A. 3 B. 5 10. The following is a program segment and the definition of a procedure named sub. . procedure sub . . X 8; . apply procedure sub; X 2; print the value of X; . . . . A. What value will be printed by the program segment if X is a global variable? _ B. What value will be prin
21、ted by the program segment if X is a declared as a local variable within the procedure? _ ANSWER: A. 8 B. 2 11. To say that a grammar is ambiguous means that _ _ . ANSWER: the grammar allows more than one parse tree for a single string 12. List three items of information that would be contained in a
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 大学 英语 期末 复习 TestBank1006
限制150内