Exam 11: Classes and Objects

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Constructors that contain parameters are called ____.

Free
(Multiple Choice)
4.7/5
(42)
Correct Answer:
Verified

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:
Verified

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:
Verified

D

You create a Public property using a ____.

(Multiple Choice)
4.9/5
(32)

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)

A constructor that has no parameters is called the ____.

(Multiple Choice)
4.8/5
(31)

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)

The Class statement ends with the keyword(s)____.

(Multiple Choice)
4.9/5
(41)

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)

You can overload any of the methods contained in a class.

(True/False)
4.9/5
(28)
Showing 1 - 20 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)