CIS 2200 HOMEWORK #3

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

c. H

10. The association of operands with operators is called a. b. c. d. assignment precedence binding lexicographic ordering
11. The looping mechanism that always executes at least once is the statement. a. b. c. d. if.. .else do.. .while while for 2
3
15. Common loop errors are: a. b. c. d. Off-by-one Infinite loops Both a and b None of the above
16. To terminate a program, use the Java statement: a. b. c. d. System.quit(0); System.end(0); System.abort(0); System.exit(0);
2. A compound statement is enclosed between:
3. A multi-way if-else statement a. allows you to choose one course of action. b. always executes the else statement. c. allows you to choose among alternative courses of action. d. executes all Boolean conditions that evaluate to true. 4. The controlling expression for a switch statement includes all of the following types except: a. b. c. d. char int byte double should
5. To compare two strings lexicographically the String method be used. a. b. c. d. equals equalsIgnoreCase compareTo ==
1
6. When using a compound Boolean expression joined by an && (AND) in an if statement: a. Both expressions must evaluate to true for the statement to execute. b. The first expression must evaluate to true and the second expression must evaluate to false for the statement to execute. c. The first expression must evaluate to false and the second expression must evaluate to true for the statement to execute. d. Both expressions must evaluate to false for the statement to execute. 7. The OR operator in Java is represented by: a. ! b. && d. None of the above 8. The negation operator in Java is represented by: a. ! b. && C. I I d. None of the above 9. The a. b. c. d. * dot += decrement operator has the highest precedence.
17. Good debugging techniques include: a. b. c. d. Inserting output statements in your program. Tracing variables Using an IDE debugger All of the above
CIS 2200 Programming in JAVA
PRINCE GEORGE'S COMMUNITY COLLEGE
Homework #3 Name: Due Date: Section:
MULTIPLE CHOICE: Circle the letter of the most correct answer (the one alternative that best completes the statement or answers the question).
1. An if selection statement executes if and only if: a. b. c. d. the Boolean condition evaluates to false. the Boolean condition evaluates to true. the Boolean condition is short-circuited. none of the above.
12. A mixture of programming language and human language is known as: a. Algorithms b. Recipes c. Directions d. Pseudocode 13. When the number of repetitions are known in advance, you should use a statement. a. while b. do.. .while C. for d. None of the above 14.A a. b. c. d. Break Continue Switch Assert statement terminates the current iteration of a loop.
相关文档
最新文档