TEST BANK
WHISPERHILLS@GMAIL.COM
Question 1.1. (TCO 1) In the systems development life cycle, the goal of the
design activity is to _____. (Points : 5)
Question 2.2. (TCO 2) To plan the code for a procedure, _____ uses standardized
symbols to show the steps the procedure must follow to reach its goal. (Points :
5)
pseudocode
a TOE chart
a class diagram
a flowchart
literals
constants
variables
Question 4.4. (TCO 3) In Visual Basic, which of the following correctly declares a
named constant with the name strCOURSE that contains the string value
BIS311? (Points : 5)
selection
sequence
repetition
interrogative
Question 6.6. (TCO 5) If intQty contains 60, what will be the value of intPrice
after executing the following code?
intPrice = 10
Case 51 To 100
intPrice = 8
intPrice = 6
Case Else
intPrice = 0
10
Question 7.7. (TCO 6) The loop below is classified as a(n) _____ loop.
Do
MsgBox( intNum.ToString() )
intNum *= intNum
infinite
pretest
posttest
counter-controlled
Question 8.8. (TCO 6) Which element of the following array contains the value
Red?
strColors(4)
strColors(3)
strColors(1)
strColors(0)
Call statement
argument list
procedure footer
procedure header
Question 10.10. (TCO 7) In the following function, what should go in the blank
in the function header?
dblRatio = dblNumerator/dblDenominator
Return dblRatio
End Function (Points : 5)
ByVal
ByRef
As Integer
As Double
object
attribute
method
class
End Function
End Class
If crate is an instance of Box, which of the following statements assigns a value
to a property? (Points : 5)
crate.Length = 42
dblVolume = crate.GetVolume()
crate.GetVolume(42)
Call crate.Length(42)
Dataset Designer
Page 2
Question 1. 1. (TCOs 1, 2, and 3) You have been asked to develop an application
with the following business requirements: The user will enter an original price.
When the user clicks a Calculate Sale Price button, the application will calculate
a sale price by multiplying the original price by 80%. The application will display
the sale price to the user.
(a) Develop a TOE chart for this application. You do not need to put it in table
form, but list what would go in the Task column, what would go in the Object
column, and what would go in the Event column for each row of the chart. Your
chart should have at least three rows: one for input, one for processing, and one
for output.
(b) Write pseudocode for the button-click event procedure in this application.
(c) Identify two variables and one constant that you would declare for this
application. For each, provide a variable or constant name that follows the
syntax rules of Visual Basic and the Hungarian naming convention, and an
appropriate Visual Basic data type. (Points : 30)
Spellchecker
Else
End If
(a) What type of control structure is this? Be as specific as possible, and justify
your answer.
(b) Describe step by step how this code will be executed and what will be
displayed to the user for each of the following values of intScore: 99, 100, and
101.
(c) Rewrite this code snippet so that it still produces the same results, but
changing the condition in the first line from intScore >= 100 to intScore < 100.
(Points : 30)
Spellchecker
(a) What type of control structure is this? Be as specific as possible, and justify your
answer.
The control structure is an if statement that returns a message based on the value of the
variable intScore.
(b) Describe step by step how this code will be executed and what will be displayed to the
user for each of the following values of intScore: 99, 100, and 101.
For 99, the message displayed on the screen will be Better luck next time because 99 is
less than 100.
For 100, the message will be Great job as the value is included in the scoop on the
variable intScore. i.e. 100 =100 evaluates to true.
For 101, the message will be Great job as the value is included in the scoop on the
variable intScore. i.e 101 >100 evaluates to true.
(c) Rewrite this code snippet so that it still produces the same results, but changing the
condition in the first line from intScore >= 100 to intScore < 100. (Points : 30)
intTotal += intNum
Next intNum
MessageBox.Show( intTotal.ToString() )
(a) What type of control structure is this? Be as specific as possible, and explain
your answer.
(b) Identify the counter variable and the accumulator variable in this loop.
Explain your answer.
(c) Describe step by step how this code will be executed and what value will be
displayed in a message box to the user. (Points : 30)
Spellchecker
(a) What type of control structure is this? Be as specific as possible, and explain your
answer.
The control structure is a for loop that controls the execution of the condition and
incrementing the intNum variable by 1, until the value 5 is reached.
(b) Identify the counter variable and the accumulator variable in this loop. Explain your
answer.
The counter variable is intNum as it is increased by one within the loop and used to control
the loop while the accumulator variable is intTotal because it stores the incremented value.
(c) Describe step by step how this code will be executed and what value will be displayed in
a message box to the user. (Points: 30)
The variable intTotal is initialised to 0, then the counter variable (intNum) is increased by
one at each step until it obtains a value 5, then the loop stops. The message displayed on
the screen will be: 0 1 2 3 4 5.
Question 1. 1. (TCO 7) (a) Explain the difference between passing by value and
passing by reference when passing variables to a Sub procedure or function.
(b) Describe a specific example of using a Sub procedure when you would pass a
variable by value.
(c) Describe a specific example of using a Sub procedure when you would pass a
variable by reference. (Points : 30)
Spellchecker
(a) Explain the difference between passing by value and passing by reference when
passing variables to a Sub procedure or function.
(b) Describe a specific example of using a Sub procedure when you would pass a variable
by value.
Function sum {
Result=12 ;}
(c) Describe a specific example of using a Sub procedure when you would pass a variable
by reference. (Points : 30)
Function sum {
a=10, b=12;
Sum=a+b ;}
(a) Describe at least two classes that you could use in this application and what
each class would represent in the real world.
(b) Describe at least two properties of each class you identified in part (a) and
identify the data type you would use for each property.
(c) Describe at least one method of each class you identified in part (a), giving
for each the method name and the action performed by the method. (Points :
30)
Spellchecker
(a) Describe at least two classes that you could use in this application and what each class
would represent in the real world.
(b) Describe at least two properties of each class you identified in part (a) and identify the
data type you would use for each property.
(c) Describe at least one method of each class you identified in part (a), giving for each the
method name and the action performed by the method. (Points : 30)
Question 3. 3. (TCOs 8, 9, and 10) (a) Explain the roles of primary and foreign
keys in a relational database.
(b) In a two-tier architecture with a thin client and fat server, describe the
functions performed by the client and by the server in processing a request by a
user for information from a database.
(c) In a Visual Basic application that retrieves data from a database, describe
the role of a TableAdapter object. (Points : 30)
Spellchecker
(a) Explain the roles of primary and foreign keys in a relational database.
(b) In a two-tier architecture with a thin client and fat server, describe the functions
performed by the client and by the server in processing a request by a user for information
from a database.
.
(c) In a Visual Basic application that retrieves data from a database, describe the role of a
TableAdapter object. (Points : 30)