Chapter 4 and 5 Sample Test

Section 4.2 Sub Procedures, Part II 1. The value of an argument in a call statement can be changed by a Sub procedure only if the same name is used in the Sub procedure's parameter list. a. True b. False Section 5.1 Relational and Logical Operators 2. Which value for x would make the following condition true: x >= 5 a. x is equal to 7 b. x is equal to 5 c. x is equal to 5.001 d. all of the above Section 4.2 Sub Procedures, Part II 3. What will be displayed when the button is clicked?

a. tin can b. can tin c. tin tin d. can can Section 4.1 Sub Procedures, Part I 4. Arguments and parameters can be used to pass values to Sub procedures from event procedures or other Sub procedures. a. True b. False

Section 4.1 Sub Procedures, Part I 5. What will be the output of the following program when the button is clicked?

r c. 8 c.3 Select Case Blocks 7. True b. Case 1 To 5. 5 d. e d.4 Modular Design 6. Case 1 To 8. A GoTo statement can always be replaced by a combination of the three logical structures of structured programming. Which Case clause will be true whenever the value of the selector in a Select Case block is between 1 and 5 or is 8? a. progr b. Constructs in which an If block is contained inside another If block are called: a. False Section 5. sequential If blocks d.3 Select Case Blocks 8.a. progre Section 4. 8 Section 5. a. none of the above . Case 1 To 8 b. False Section 5. Case 1 To 5. The Case Else part of a Select Case block is optional. multi-If blocks b. a. True b.2 If Blocks 9. nested If blocks c.

Part I 13. a. conveying c. True b. 3 d.3 Select Case Blocks 14.2 If Blocks 12. Sometimes the statements Tally(num) and Tally((num)) have the same effect. Part I 10. evaluating d.1 Sub Procedures.1 Sub Procedures. None of the above. False Section 5. True b. 2 c. True b. Section 4. False Section 5. a. You can specify a range of values in a Case clause by using the To keyword. The process of transmitting values to a Sub procedure is known as ______________. a.Section 4. Part II 11. What will be displayed by the following program when the button is clicked? a.2 Sub Procedures. passing b. 1 b. a. Each parameter defined for a Sub procedure corresponds to an argument passed in a call statement for that procedure. False . referencing Section 4.

True b. False Section 4. module Section 4.5 num2 = 6. arguments Section 4.1 Sub Procedures. What will be the output when TruncateSum is used in the following lines of code? Dim num1.3 Function Procedures 16. a. Items appearing in the parentheses of a call statement are known as _______________. num3) a. call strings c. decision d. driver c. num3 As Double num1 = 3.4 Modular Design 15. Consider the following Sub procedure. parameters d. Part I 18. it cannot directly display information in a text box. Part I 17. 0 d. num2. object b. 11 . A(n) __________ is an encapsulation of data and code that operates on the data.75 num3 = 1 TruncateSum(num1.1 Sub Procedures. call variables b.Section 4. num2. 12 c. a. Although a function can return a value. a. 10 b.

Part I 19. Section 5. a "dummy" program designed solely to call a single procedure and examine its returned values. What will be displayed when the button is clicked? a. d. Every Select Case block can be replaced by If blocks. a. ABA Section 4.2 If Blocks 22. What will be the output when the button is clicked? a.3 Select Case Blocks 21. In modular programming. another name for the team leader of a project.1 Sub Procedures. b. True b. 0 . abc d. never to be used. False Section 5. one of the event procedures that a user can invoke. AAB b. BAA c. c.Section 4.4 Modular Design 20. a driver is a.

Part I 28. They are synonymous terms.NET conditional statement? a. a.001 d. 2 < n Or < 5 c. False Section 4.1 Relational and Logical Operators 25. Which one of the following is true about arguments and parameters? a. Part I 23. Section 4. Arguments appear in call statements. Which value for x would make the following condition true: (x >= 5) And (x <= 6) a. Parameters appear in call statements. A Function may return up to two values. a. One may use an If block within a Select Case block. parameters appear in Sub statements.1 Relational and Logical Operators 24. (2 < n) Or (n < 5) Section 5. True b. Which of the following is a valid VB. arguments appear in Sub statements. a. An error will occur. 6 d. x is equal to 5 c. b. Both constants and expressions can be used as arguments in call statements. 2 < n < 5 b. c.1 Sub Procedures.3 Select Case Blocks 26. 2 < n Or 5 d. Section 5. x is equal to 7 b. True . x is equal to 5. 3 c. They are completely unrelated in a program.1 Sub Procedures. True b. d. False Section 4.b. x is equal to 5 and x is equal to 5.3 Function Procedures 27.001 Section 5.

When an If block has completed execution. False Section 4. Syntax error d. the process whereby a malfunctioning program is fixed by correcting one "bug" at a time. the program instruction immediately following the If block is executed.2 If Blocks 31. False Section 4.4 Modular Design 30. False Section 5. Most modern programmers use a blend of traditional structured programming along with object-oriented design. breaking a large task into smaller tasks. Section 5. the belief that increasing the number of people working on a project decreases the time it will take to complete the project.4 Modular Design 29. b.3 Select Case Blocks 32. Unknown acronym. True b. What will be the output of the following program when the button is clicked? a. Drug Enforcement Agency c. a. Stepwise refinement refers to a.b. any procedure that calls another procedure (and so on) to accomplish a task. True b. Section 5. d. Sorry. Federal Aviation Administration b. c. a.1 Relational and Logical Operators .

When the button is clicked. a. When using the logical operator "Or". either the left or right part. only the left part. x is equal to 7 b. False Section 5. True b. One may use a Select Case block within an If block. The declaration line of a Function procedure must include parameters. Section 4. True b.1 Relational and Logical Operators 37. True b. x is equal to 5.001 d. all of the above Section 4. Which value for x would make the following condition true: Not (x >= 5) a. what part of the expression must be true? a.2 Sub Procedures. but not both. either the left or right part. Part II 36. only the right part. a. c. b.3 Function Procedures 34.2 If Blocks Section 5. x is equal to 4 c.1 Sub Procedures. the output of the following program will be 20.3 Select Case Blocks 35. d. False Section 4. a.33. Part I . False Section 5.

And." d. Section 4. If c. a. False Question 46 (2 points) 41. And.38. product. a. Not b. Suppose you want to write a procedure that takes three numbers. and returns their sum. It is best to use a Function procedures for this task.3 Function Procedures 39.1 Relational and Logical Operators The three main logical operators are ________. _________. Not. True b. and ________. If d." b.1 Sub Procedures. a. c. and average. False Section 4. And. True b. and num3. True Section 4. Nothing is wrong with them. False . Constant values like 1000 cannot be passed. False. Or. var1 is not of the same data type as "The Jetsons. Function names should be suggestive of the role performed. a. only variables. True b. Sub procedures can be called only once during the execution of a program. What is wrong with the following call statement and its corresponding Sub statement? a. Section 5. Or.3 Function Procedures 42. The names also must conform to the rules for naming variables. Not. It is not valid to pass something like "The Jetsons. num2. num1. Part I 40.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.