CMP1 4.1 TestBank Questions for Computer Programming I Obj 4.1

Question Answer
Which data type is appropriate to store the number five (5)? Integer
Which data type is appropriate to store the value 75.9? Double
Using the statement below, what is the initial value of this variable? Dim intHours As Integer 0
Jayce wants to store the student name “Ellen” in a variable. Which data type should he use? String
The most appropriate data type for the word “Value” is: string.
Which is written in Hungarian Notation? decAmountDue
How do you declare a variable whose value cannot be changed after assignment? Replace Dim with Const
Hugh declares a variable in the event procedure code for a button. What scope is this variable? Local
What is the correct code to create a message box from the following code? lblcost.Text= "The cost of the product is: " & (deccost + dectax) MessageBox.Show ("The cost of the product is: "& (deccost + dectax))
Josie is writing a program and needs a variable that can be accessed from multiple event procedures. What scope of variable should she use? Global
Which data type is used to declare a variable that will store the value 0.113? Double
Variable names: must begin with a letter.
Kirk wants to declare a variable that holds its value beyond the normal lifetime. How should he declare it? Static intGrade As Integer
John needs a variable to hold its value beyond its normal lifetime. What type of variable should he use? Static
The words “A Double data type should be always stored as a Double data type!” would be best stored in which data type? String
If you assign a number, such as 3.7, to an integer variable, what will be stored in the memory location? 4
What data type is returned from a text box control? String
If you assign a number such as 3.768 to a double variable, what will be stored in the memory location? 3.768
Which method formats output as currency? dblMoney.ToString("$
Susan declares a variable within an If statement. What is the scope of this variable? Procedural
What value does the statement intWeight=Convert.toInt32(txtWeight.Text) return if the value keyed by the user was 47? 47

Get access to
knowledge base

MOney Back
No Hidden
Knowledge base
Become a Member
Haven't found the Essay You Want? Get your custom essay sample For Only $13.90/page