Exam 11: Classes and Objects

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

What are classes and objects? How are they used in object-oriented programming?

(Essay)
4.8/5
(43)

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.8/5
(31)

The following sample of code contains errors. Rewrite the incorrect statements to correct all errors. -Public Class Truck Private Property Miles As Decimal Public Function New() _Miles = 0 End Function Public Sub New(ByVal decM As Decimal) Miles = decM End Sub Public Overrider Function GetMPG()As Decimal 'returns the miles per gallon for a truck Return _Miles / 30 End Function End Class 'derived class Public Class Car Receives Truck Public Sub New() MyBase.New() End Sub Public Sub New(ByVal decM As Decimal) MyBase.New(decM) End Sub Public Function GetMPG()As Decimal Return _Miles / 18 End Function End Class

(Essay)
4.9/5
(43)

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. -An application needs to calculate the sales tax for an order.Which of the following is a valid example of a variable in a class that can be validated in the Set block of a Property procedure?

(Multiple Choice)
4.8/5
(39)

The code in the ____ allows an application to assign a value to the Private variable associated with the property.

(Multiple Choice)
4.8/5
(28)

When a variable in a class is declared using the Public keyword,it can be used only within the class.

(True/False)
4.7/5
(38)

A class can have multiple default constructors.

(True/False)
4.9/5
(32)

The Inherits clause is the keyword ____ followed by the name of the class whose attributes and behaviors you want the derived class to inherit.

(Multiple Choice)
4.8/5
(31)

____ is useful when two or more methods require different parameters to perform essentially the same task.

(Multiple Choice)
4.8/5
(30)

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.8/5
(29)

Every object has attributes and behaviors.Describe each of these,including the two types of behaviors an object can have.

(Essay)
4.8/5
(34)

A Public property procedure creates a property that is visible to any application that contains an instance of the class.

(True/False)
4.9/5
(25)

Which of the following clauses allows a derived class named Truck to have the same attributes and behaviors as its base class,which is named Automobile?

(Multiple Choice)
4.8/5
(40)

A(n)____ is a class method whose sole purpose is to initialize the class's Private variables.

(Multiple Choice)
4.8/5
(35)

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)
4.8/5
(38)

What is a constructor? Explain the difference between a default constructor and a parameterized constructor.

(Essay)
4.7/5
(30)

The Tree class is derived from a base class named Plant.Which of the following statements can be used by the Tree class to invoke the Plant class's default constructor?

(Multiple Choice)
4.8/5
(38)

____ are the actions to which an object can respond.

(Multiple Choice)
4.8/5
(25)

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 Discount class is used by applications for assigning appropriate discounts to orders.A Public property within the class is made ReadOnly.Which of the following is true about this ReadOnly property?

(Multiple Choice)
4.8/5
(32)

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
(22)
Showing 41 - 60 of 60
close modal

Filters

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