Exam 11: Classes and Objects

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

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
(37)

A class is anything that can be seen, touched, or used; in other words, a class is nearly any thing .

(True/False)
4.8/5
(41)

Case-Based Critical Thinking Questions 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
(35)

A base class named DeliveryFee contains a function named CalcFee that calculates an order's delivery fee using the following formula: total * .05. Write the method's procedure header in the base class that will allow the derived class to override the function.

(Essay)
4.9/5
(30)

Problems - Correcting Logic and Code Errors 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

(Essay)
4.9/5
(31)

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

(True/False)
4.9/5
(37)

Write a Class statement that defines a class named Employee. (The class contains four public variables named EmpID , LastName , FirstName , and PayRate . The EmpID , LastName , and FirstName variables are String variables. The PayRate variable is a Decimal variable.) Then write a statement that creates an Employee variable named partTime and also instantiates an Employee object, assigning it to the partTime variable.

(Essay)
4.9/5
(44)

A one-dimensional array's Length property is an example of a ReadOnly property.

(True/False)
4.9/5
(40)

Case-Based Critical Thinking Questions 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. The Shoe class is used to create an object that represents a standard shoe. The Shoe class needs to be used in an application for boots. You have copied the Shoe.vb file into the boot application. What do you need to do next to include the file in the boot application?

(Multiple Choice)
4.7/5
(35)

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

(Multiple Choice)
4.8/5
(33)

Which of the following instantiates a Product object and assigns it to the bookcase variable?

(Multiple Choice)
4.8/5
(33)

A Property procedure begins with the keywords ____.

(Multiple Choice)
4.8/5
(42)

The first word in a method name should be a(n) ____.

(Multiple Choice)
4.8/5
(28)

A(n) ____ property gets its value from the class itself rather than from the application.

(Multiple Choice)
4.9/5
(31)

The Lumber class definition contains two Private variables named _dblLength and _decPricePerFoot . The default constructor initializes the Private variables to 0 when the Lumber object is created. Write the statements to create a parameterized constructor, and then write the Dim statement using the parameterized constructor to instantiate and initialize the Lumber object where the number of feet of lumber is 31.5 and the price per foot is 1.85.

(Essay)
5.0/5
(41)

Every object has ____, which are the characteristics that describe the object.

(Multiple Choice)
4.9/5
(35)

Write the code for an auto-implemented property named TaxableIncome. The property's data type is Decimal. Then list the two hidden items it creates.

(Essay)
4.7/5
(29)

A base class named DeliveryFee contains a function named CalcFee that calculates an order's delivery fee using the following formula: total * .05. The derived class named InstallationFee contains the CalcFee method. However, the fee formula is as follows: ( total * .05) + 250. Write the function for the derived class.

(Essay)
4.9/5
(30)

A constructor that has no parameters is called the ____.

(Multiple Choice)
4.9/5
(41)

Constructors that contain parameters are called ____.

(Multiple Choice)
4.8/5
(38)
Showing 41 - 60 of 60
close modal

Filters

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