Unit 4: Sequential ProcessingPage 1
NameScore / / 20
Update Value
Programming Logic - Beginning
152-101
Unit 4: Sequential Processing
This worksheet is based on the exercises starting on page 175 of the Lego book.
- ¼ point for each incorrect answer.
Review Questions & Exercises
- The ______control allows you to capture input the user type on the keyboard.
- ______is the standard prefix for Textbox control names.
- ______means that one string is appended to another.
- The ______character allows you to break a long statement into two or more lines of code.
- The ______character is actually two characters: a space followed by an underscore.
- The control that has ______is the one that receives the user’s keyboard input or mouse clicks.
- The order in which controls are accessed using the Tab key is called the ______,
- (not assigned)
- If you do NOT want a control to receive focus when the user presses the Tab key, set its ______property to ______.
- An access key is a key that you press in combination with the ______key to quickly access a control such as a button.
- You define a control’s access key through its ______property.
- A ______is a storage location in the computer’s memory used for holding information while the program is running.
- A ______is a statement that causes VB to create a variable in memory.
- A variable’s ______determines what kind of information a variable can hold.
- A ______variable is declared inside a procedure.
- A ______error is generated when your program attempts to convert non-numeric strings to numeric values.
- A ______is a specialized routine that performs a specific operation and then returns a value.
- ______converts a string to an integer.
- (not assigned)
- A ______is information being passed to a function.
- When two operators share an operand, the operator with ______executes first.
- A ______is like a variable whose content is read-only—it cannot be changed while the program is running.
- (not assigned)
- A form’s ______procedure executes each time a form is started.
- (not assigned)
True or False.If the answer is false, write why the answer is false.
- T FThe TextBox control’s Text property hold the text entered by the user.
- T FYou can access a TextBox control’s Text property in code.
- T FThe string concatenation operator automatically inserts a space between the joined strings.
- T FYou cannot break up a word with the line-continuation character.
- T FYou can put a comment at the end of a line, after the line-continuation character.
- T FOnly controls capable of receiving input, such as a TextBox or Button, may have focus.
- T FYou can cause a control to be skipped in the tab order by setting its TabPosition property to False
- (not assigned)
- T FA control whose Visible property is set to False can still receive focus.
- (not assigned)
- T FWhen you assign an access key to a button, the user can trigger a Click event by typing Alt+ the access key.
- T FA local variable may be accessed by any event procedure in an application.
- T FWhen a string variable is created in memory, VB assigns it a default value of 0.
- T FA variable’s scope is the time during which the variable exists in memory.
- T FA variable declared inside a procedure is only visible to statements inside the same procedure.
- T FThe CSng function converts a number to a string.
- T FIf the CSng function cannot convert its argument, it causes a runtime error.
- T FThe multiplication operator has a higher order of precedence than the addition operator.
- T FA named constant’s value can be changed by a programming statement while the program is running.
- T FThe statement lblMessage.BackColor = Green will set the lblMessage control’s background color to green.
- T FYou can select multiple controls simultaneously with the mouse.
- T FYou can change the same property for multiple controls simultaneously.
- (not assigned)
- (not assigned)
Multiple Choice (circle or highlight the BEST answer)
- When the user types input into a TextBox control, it is stored in which property?
- Input
- Text
- Value
- Keyboard
- Which character is the string concatenation character?
- *
- %
- @
- In code, you move focus to a control with which property?
- MoveFocus
- SetFocus
- ResetFocus
- Focus
- Which form property allow you to specify a button to be clicked when the user presses the Enter key?
- DefaultButton
- AcceptButton
- CancelButton
- EnterButton
- Which form property allow you to specify a button to be clicked when the user presses the Esc key?
- DefaultButton
- AcceptButton
- CancelButton
- EnterButton
- You ca modify a control’s position in the tab order by changing which property?
- TabIndex
- TabOrder
- TabPosition
- TabStop
- You can assign an access key to a button through which property?
- AccessKey
- AccessButton
- Mneumonic
- Text
- (not assigned)
- You declare a named constant with which keyword?
- Constant
- Const
- NamedConstant
- Dim
- The part of a program in which a variable is visible and may be access by programming statements is the variable’s
- segment
- lifetime
- scope
- module
- The time during which a variable exists in memory is the variable’s
- segment
- lifetime
- scope
- module
- Which string is returned from the function FormatPercent(0.25)?
- “0.25%”
- “2.50%”
- “25.00%”
- “0.25”
Short Answer (do only the numbers listed)
2.How do you erase the contents of TextBox using code?
7.How do you assign an access key to a button?
8.How does assigning an access to a button change it’s appearance?
11.Why should you always make sure a string variable is initialized or assigned a value before it is used in an operation?
12.When is a local variable destroyed (removed from memory)?
15.Complete the following table by providing the value of each mathematical expression.
ExpressionValue
5 + 2 * 8______
20 / 5 – 2______
4 + 10 * 3 – 2______
(4 + 10) * 3 – 2______
16.Complete the following table by indicating the format function’s return value.
Function CallReturn Value
FormatNumber(67521.584)______
FormatCurrency(67521.584)______
FormatNumber(46,0)______
FormatPercent(.284)______
17.Describe one way to select multiple controls in Design mode.
What do you think?
9.Suppose a number is used in a calculation throughout a program and must be changed periodically. What benefit is there to using a named constant to represent the number?