Argument not specified for parameter

BlueOysterCult

Well-known member
Joined
Oct 3, 2003
Messages
84
Hello All I am back!!
I cant 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"

Code:
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

Code:
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
 
The first thing you need to do is place the following two lines at the top of every code page you have.

Code:
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.
 
Back
Top