Exam 11: Classes and Objects
Exam 1: An Introduction to Visual Basic 201544 Questions
Exam 2: Designing Applications60 Questions
Exam 3: Using Variables and Constants60 Questions
Exam 4: The Selection Structure60 Questions
Exam 5: More on the Selection Structure58 Questions
Exam 6: The Repetition Structure60 Questions
Exam 7: Sub and Function Procedures60 Questions
Exam 8: String Manipulation60 Questions
Exam 9: Arrays60 Questions
Exam 10: Structures and Sequential Access Files60 Questions
Exam 11: Classes and Objects60 Questions
Exam 12: Web Applications60 Questions
Exam 13: Working With Access Databases and Linq60 Questions
Exam 14: Access Databases and SQL60 Questions
Select questions type
Constructors that contain parameters are called ____.
Free
(Multiple Choice)
4.7/5
(42)
Correct Answer:
D
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
-Public Class Employee
Private _strEmpId As String
Public _decSalary As Decimal
Public Property EmpId As String
Set(ByVal value As String)
_strEmpId = value
End Set
End Property
Public Property Salary As Decimal
Get
Return _decSalary
End Get
Set(ByVal value As Decimal)
Salary = value
End Set
End Property
Public Function New()
_strEmpId = String.Empty
_decSalary = 0
End Sub
End Class
Free
(Essay)
4.8/5
(30)
Correct Answer:
Public Class Employee
Private _strEmpId As String
Private _decSalary As Decimal
Public Property EmpId As String
Get
Return _strEmpId
End Get
Set(ByVal value As String)
_strEmpId = value
End Set
End Property
Public Property Salary As Decimal
Get
Return _decSalary
End Get
Set(ByVal value As Decimal)
_decSalary = value
End Set
End Property
Public Sub New()
_strEmpId = String.Empty
_decSalary = 0
End Sub
End Class
Case 1 - chaussure.com
chaussure.com is an online shoe retailer. The applications for the web site are developed using classes and object-oriented programming techniques.
-Rather than reuse the Shoe class,you have decided to derive the Boot class from the Shoe class.Which of the following creates the derived Boot class?
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
D
Private variables represent properties that will be seen by anyone using an object created from the class.
(True/False)
4.9/5
(35)
What is an auto-implemented property and what does it automatically create?
(Essay)
5.0/5
(33)
Write the statements to create the default constructor for the Furniture class statement in the previous problem.Then write the Dim statement to use the default constructor to instantiate a Furniture object,assigning the object to a variable named sofa.
(Essay)
5.0/5
(33)
Every object has ____,which are the characteristics that describe the object.
(Multiple Choice)
4.7/5
(34)
If you create an auto-implemented property named State,Visual Basic will create a hidden Private variable named ____.
(Multiple Choice)
4.8/5
(37)
A one-dimensional array's Length property is an example of a ReadOnly property.
(True/False)
5.0/5
(45)
Define the term "inheritance" in object-oriented programming and describe its use.
(Essay)
4.9/5
(40)
Write a Class statement that defines a class named Furniture.The class contains two private variables named _strItemNum and _dblPrice.Name the corresponding properties ItemNumber and Price.
(Essay)
4.8/5
(33)
In a Property procedure,the code contained in the ____ block allows an application to retrieve the contents of the Private variable associated with the property.
(Multiple Choice)
4.9/5
(37)
In its simplest form,the Class statement can be used in place of the Structure statement.
(True/False)
4.8/5
(30)
Explain the difference between Public and Private variables for a class.
(Essay)
4.8/5
(30)
Case 1 - chaussure.com
chaussure.com is an online shoe retailer. The applications for the web site are developed using classes and object-oriented programming techniques.
-Which of the following is a valid example of an object?
(Multiple Choice)
4.8/5
(38)
Write the appropriate block of code to complete a Public procedure based on the following statements:
Private _decTotalSales As Decimal
Public WriteOnly Property TotalSales As Decimal
End Property
(Essay)
4.9/5
(38)
Showing 1 - 20 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)