Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello All I am back!!

I can't seem to figure the message I am getting - "Argument not specified for parameter" I think I have been looking at it too long.

 

Anyway it concerns "vinId"

 

Public Class Car
   Public ColorInterior As String
   Public ColorExterior As String
   Private BasicPrice As Decimal = 0.07
   Private StickerPrice As Decimal
   Private DealerPrice As Decimal
   Private Const UsedPrice As Decimal = 0.05
   Private Const LuxuryPrice As Decimal = 0.11
   Public category As String
   Public warranty As String
   Public make As String
   Public model As String
   Public year As String
   Private vin As Long
   Private vinId As Long

#Region "Constructor"
   Public Sub New(ByVal DealerPrice As Decimal, ByVal originalPrice As Decimal, ByVal category As String, ByVal make As String, ByVal model As String, ByVal year As String, ByVal vin As Long, ByVal vinId As Long)
       DealerPrice = originalPrice
       Me.category = category
       Me.make = make
       Me.model = model
       Me.year = year
       Me.vin = vin
       Me.vinId = vinId
   End Sub

#End Region

#Region "Method"
   Public Function price(ByVal amountCar As Decimal) As Decimal
       If category.Equals("usedCar") Then
           StickerPrice = Math.Round(DealerPrice * UsedPrice)
       ElseIf category.Equals("basicCar") Then
           StickerPrice = Math.Round(DealerPrice * BasicPrice)
       Else : category.Equals("luxuryCar")
           StickerPrice = Math.Round(DealerPrice * LuxuryPrice)

       End If
       Return StickerPrice

   End Function
   Public Function carWarranty(ByVal warrantyCar As Decimal) As Decimal
       If category.Equals("usedCar") Then
           warranty = "1 -year, 1,000 miles"
       ElseIf category.Equals("basicCar") Then
           warranty = "4-year, 40,000 miles"
       Else : category.Equals("luxuryCar")
           warranty = "5-year, 50,000 miles"
       End If
       Return warranty

   End Function
#End Region
End Class

 

the Module

 


Imports System
Module Inventory
   Sub Main()
       Dim CarPrice As Decimal
       Dim myNewCar As New Car("Used", "honda", "Accord", "1999")
       CarPrice = myNewCar.price()

       Debug.WriteLine(CarPrice)
   End Sub
End Module

 

it is giving me the error in the Module at "myNewCar"

 

Rob

  • Moderators
Posted

The first thing you need to do is place the following two lines at the top of every code page you have.

 

Option Explicit On
Option Strict On

 

Next the parameters for the Constructor of the class Car does not match with what you have in your module.

 

The same goes for the method 'price', you are not sending the required argument of 'amountCar As Decimal'.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...