






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Exam; Professor: He; Class: PROGRAMMING IN VISUAL BASIC; Subject: Information Technology; University: Armstrong Atlantic State University; Term: Unknown 1989;
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!
Modified True/False (45 points. For each question, 1 point for decision, 0.5 point for correction) Indicate whether the sentence or statement is true or false. If false, change the identified word or phrase to make the sentence or statement true. ____ 1. A selection structure contained within either the true or false path of another selection structure is called a(n) combined selection structure. _____________________ ____ 2. Every Select Case logic structure must be terminated using an End Case terminus. __________________ ____ 3. The default radio button is designated by setting the Checked property to a value of True.
____ 4. The minimum number of radio buttons in a group is one. ____________________ ____ 5. The Visual Basic .NET Get statement causes the execution of a user-defined Sub procedure.
____ 6. A check box group with six choices can have a maximum of five items selected. ______________________ ____ 7. To remove a graphic from a picture box control while a procedure is running, set the picture box control's Image property to the keyword Nothing. ________________ ____ 8. Button captions should always appear on one line. _________________ ____ 9. A pretest loop structure has the test that controls execution at the top of the code. _______________________ ____ 10. A(n) pretest loop structure will always execute one time. ______________________ ____ 11. If the stepvalue is omitted from the code of a For...Next loop structure, a value of zero is used.
____ 12. A control whose width and height are set to zero pixels is invisible on the form. _______________________ ____ 13. The diamond symbol in a flowchart is used to identify a selection or repetition activity.
____ 14. A(n) octagon is used to visually represent the For...Next loop structure. _________________________ ____ 15. The first control added to a form initially has an index of one. __________________________ ____ 16. The last control added to a form is the first control in the Controls collection. ______________________ ____ 17. A(n) object variable is a memory location that stores the address of an object. _____________________ ____ 18. A(n) index indicates the Control object's position in the collection. ______________________ ____ 19. A block of program code that performs a specific task is called a(n) sub-program.
____ 20. When a TextBox KeyPress event is triggered the KeyChar property and contents are stored in the e parameter.
____ 21. Every Sub procedure footer is marked by using the statement End Procedure. ____________________ ____ 22. The data received by a Sub procedure or a Function are referred to as arguments.
____ 23. In Visual Basic .NET, the Value keyword is used to pass a variable by value. ______________________
____ 24. The default method of passing variable data in Visual Basic.NET is by value. _______________________ ____ 25. The verb used in a user-defined function to return a value from a function is the send verb.
____ 26. The Math.Round(87.653, 2) rounds to two decimal positions. _____________________ ____ 27. The method to remove characters from the left and right end of a string is the TrimBoth method.
____ 28. When using the IndexOf search method, to begin the search at the first character you specify a one as the argument. __________________ ____ 29. The Replace string method will replace the first occurrence(s) of the item to be replaced with the new value.
____ 30. The StartsWith string method will return true if a match is found and false if there is no match starting on the left side of a string. ______________________ Multiple Choice (40 points) Identify the letter of the choice that best completes the statement or answers the question. ____ 31. When a nested selection structure is encountered, the _____ decision is always made by the inner selection structure. a. primary b. secondary c. binary d. none of these ____ 32. The case executed when none of the preceding cases are true is the Case __________. a. Otherwise b. Else c. Next d. Last ____ 33. When both the upper and lower bounds are known for a range when constructing a Case expression, it is best to use the _____ keyword in identifying the range. a. From b. Is c. To d. none of these ____ 34. When only one bound is known for a range when constructing a Case expression, it is best to use the _____ keyword in identifying the range. a. From b. Is c. To d. none of these ____ 35. If a Case selection structure is to determine which school building to assign to a student based upon grade using the following table, which of the following expression lists is not correct in assigning students to the correct building? Grade Number School Building 1-6 Grade School
b. if Handles is OhioTaxButton then c. If sender is OhioTaxButton d. If CalcTax is OhioTaxButton ____ 42. The expression contained in a Case clause can contain which of the following? a. a property b. a function c. constant(s) d. variable(s) e. all of these ____ 43. Which of the following is not one of the three main programming structures? a. recursion b. repetition c. sequence d. selection ____ 44. Which of the following is not a Visual Basic .NET loop structure statement? a. For Each... Next b. For... Next c. Do... Loop d. Go... Again ____ 45. Consider the following code segment and determine the value of intNumber that displays in the Output window. Dim intCount, intNumber as integer intCount = 0 intNumber = 0 Do intNumber = intNumber + 2 intCount = intCount + 1 Loop While intCount < 3 Debug.WriteLine(intNumber) a. 2 b. 4 c. 6 d. 8 ____ 46. A form's _____ event is triggered when a form is about to be closed. a. Closing b. Exit c. ShutDown d. None of these ____ 47. A text box control's _____ event occurs when the user tabs to the control, and when the Focus method is used to send the focus to the control. a. Enter b. Tab c. Focus d. None of these ____ 48. When focus is directed to a TextBox that currently has text, the text can be selected with which of the following code? a. objTextBox.SelectAll( ) b. objTextBox.HighlightText() c. objTextBox.Select()
d. None of these ____ 49. Which statement cancels the closing event triggered by clicking the close button? a. e.Cancel = True b. e.ignore = True c. e.Cancel = False d. None of the above ____ 50. If the user clicks the Close or cancel button on an input dialog box the value returned is ________. a. an empty string b. a blank character c. the numeric value zero d. None of these ____ 51. Consider the following Visual Basic .NET code: Dim intUnitsReceived as Integer, sngTotalCost as Single, strCost as String sngTotalCost= intUnitsReceived= strCost = InputBox("Enter item cost (without $ or comma), click Cancel when finished", "Data Entry") Do While strCost <> "" intUnitsReceived = intUnitsReceived + 1 sngTotalCost = sngTotalCost + val(strCost) strCost = InputBox("Enter item cost (without $ or comma), click Cancel when finished", "Data Entry") Loop The above code represents a _____ loop example. a. PostTest b. FirstTest c. PreTest d. None of these ____ 52. Consider the following Visual Basic .NET code: Dim intUnitsReceived as Integer, sngTotalCost as Single, strCost as String sngTotalCost= intUnitsReceived= strCost = InputBox("Enter item cost (without $ or comma), click Cancel when finished", "Data Entry") Do While strCost <> "" intUnitsReceived = intUnitsReceived + 1 sngTotalCost = sngTotalCost + val(strCost) strCost = InputBox("Enter item cost (without $ or comma), click Cancel when finished", "Data Entry") Loop Which instruction represents counting? a. sngTotalCost = sngTotalCost + val(strCost) b. intUnitsReceived= c. intUnitsReceived = intUnitsReceived + 1 d. strCost = InputBox("Enter item cost (without $ or comma), click Cancel when finished", "Data Entry") e. None of these
b. 1 c. 2 d. 3 e. 4 ____ 58. Variables and constants contained inside the parentheses on the Sub Procedure being called are referred to as _____. a. parameters b. arguments c. values d. None of these ____ 59. A user may select _____ items from a listbox control depending on the SelectionMode property setting. a. zero b. one c. more than one d. all of these ____ 60. The first character in a string when using the Remove method has an index value of _____. a. 0 b. 1 c. Length d. None of these ____ 61. The following instruction will remove how many characters from the string? Dim strMyString as string = "ABCDEFGH" strMyString = strMyString.Remove(2, 3) a. 1 b. 2 c. 3 d. 4 e. 5 ____ 62. The following instruction will remove which character firstly from the string? Dim strMyString as string = "ABCDEFGH" strMyString = strMyString.Remove(2, 3) a. A b. B c. C d. D e. E ____ 63. Consider the following code and determine the result and the value returned as a result of execution. Dim intIndex as integer Dim strMyString as string = "Water water everywhere and not a drop to drink" intIndex=strMyString.IndexOf("water", 0) a. - b. 1 c. 6 d. 25 e. None of these ____ 64. What is the result, strStringIn, after the execution of the following code segment in Visual Basic .NET? Dim strStringIn as String = "Tom Jones" Mid(strStringIn, 6, 2) = "am"
a. Tam Jones b. Tom James c. Tom Jones d. None of these ____ 65. Consider the following Visual Basic .NET code segment and determine the value in strDataIn after execution. Dim strDataIn as String = "987654321" strDataIn = strDataIn.Insert(3, "-") strDataIn = strDataIn.Insert(6, "-") a. 987-656- b. 987-65- c. 98-76- d. None of these ____ 66. Which of the following can be used to extract the first three characters of the strWeekDay? a. TrimStart(3) b. strWeekDay.Substring(0, 3) c. strWeekDay.Substring(3) d. both b & c e. Mid(strWeekDay, 3) ____ 67. If a variable called strVowels contains the letters "AEIOU" which of the following will create a loop to access each character in strVowels? a. For intPointer = 0 to strVowels.Length- b. For intPointer = 1 to strVowels.Length- c. For intPointer = 0 to strVowels.Length d. For intPointer = 1 to strVowels.Length e. None of these ____ 68. To remove characters from the left, right, or within a string variable you should use the _____ function. a. TrimStart b. TrimEnd c. Trim d. Remove ____ 69. Which Visual Basic .NET function is used to determine if the strStateName begins with "North"? a. FromStart b. BeginsWith c. StartsWith d. None of these ____ 70. The _____ method is used to remove the "-" characters in a variable called strSocialSecurity that contains the value "345-00-0000". a. strSocialSecurity.Remove("-" , "") b. strSocialSecurity.Replace("-" , "") c. strSocialSecurity.Change("-" , "") d. None of these Essay (15 points)