Question: 5. The Car class definition is shown in Figure 11-28. Write a Dim statement that uses the default constructor to instantiate a Car object in

5. The Car class definition is shown in Figure 11-28. Write a Dim statement that uses the default constructor to instantiate a Car object in an application. The Dim statement should assign the object to a variable named nissan. Next, write assignment statements that the application can use to assign the string “370Z” and the number 30614.75 to the Model and Price properties, respectively. Finally, write an assignment statement that the application can use to invoke the GetNewPrice function. Assign the function’s return value to a variable named dblNewPrice.

Public Class Car Private strModel As String Private _dblPrice As Double Public

Public Class Car Private strModel As String Private _dblPrice As Double Public Property Model As String Get Return _strModel End Get Set(value As String) _strModel = value End Set End Property Public Property Price As Double Get Return _dbl Price End Get Set(value As Double) _dbl Price = value End Set End Property Public Sub New() _strModel String.Empty _db1Price = 0 End Sub Public Sub New(ByVal strM As String, ByVal dblP As Double) Model = strM Price = dblp End Sub Public Function GetNewPrice() As Double Return dbl Price 1.15 End Function End Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock