Exam 11: Classes and Objects

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

In a Property procedure, the dataType must match the data type of ____ associated with the Property procedure.

(Multiple Choice)
4.7/5
(30)

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

(True/False)
4.8/5
(36)

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

(Essay)
4.8/5
(31)

Problems - Correcting Logic and Code Errors 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.8/5
(31)

The purpose of a(n) ____ in OOP is to encapsulate the properties that describe an object, the methods that allow the object to perform tasks, and the events that allow the object to respond to actions.

(Multiple Choice)
4.8/5
(27)

You can create one class from another class. In OOP, this is referred to as ____.

(Multiple Choice)
4.7/5
(32)

You create a Public property using a ____.

(Multiple Choice)
4.8/5
(36)

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

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

(Multiple Choice)
4.8/5
(39)

In the following instruction, Room is a(n) ____. Dim bedroom As New Room

(Multiple Choice)
4.8/5
(32)

In its simplest form, the Class statement can be used in place of the Structure statement.

(True/False)
5.0/5
(37)

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.9/5
(37)

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

You indicate that a class is a derived class by including the ____ clause in the derived class's Class statement.

(Multiple Choice)
4.8/5
(32)

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. 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?

(Multiple Choice)
4.8/5
(45)

When two or more methods have the same name but different parameters, the methods are referred to as ____.

(Multiple Choice)
4.9/5
(39)

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

Only an instance of a class-not the class itself-is an object.

(True/False)
4.7/5
(35)

When naming the Private variables in a class, many programmers use the ____ as the first character and then use camel case for the remainder of the name.

(Multiple Choice)
4.8/5
(39)

Define the term "inheritance" in object-oriented programming and describe its use.

(Essay)
4.8/5
(35)
Showing 21 - 40 of 60
close modal

Filters

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