Public Class CurrencyConverter
    Private summation As Decimal
    Private sum As Decimal
    Private curryncy As String
    Private exchange As Decimal
    Private final As Decimal
    Public Sub Start()
        WriteProgramInfo()
        ReadValuesAndSumNumbers()
        WriteResult()
    End Sub

    Private Sub WriteProgramInfo()
        Console.WriteLine(vbLf & "++++++ Finnish input type 0 ++++++")
    End Sub
    Private Sub ReadValuesAndSumNumbers()
        Dim done As Boolean = False
        summation = 0
        Do While (Not done)
            Console.Write(vbLf & "What is the number you want: ")
            summation = Decimal.Parse(Console.ReadLine())
            sum += summation
            done = summation = 0
        Loop
        Console.WriteLine("The sum of it is:" & sum)
        Console.Write("Currency name: ")
        curryncy = Console.ReadLine()
        Console.Write("Enter the exchange rate: ")
        Decimal.dTemp = 0
        decimal.TryParse(Console.ReadLine(), out dTemp)
        exchange = dTemp
        final = sum * exchange
    End Sub
    Private Sub WriteResult()
        Console.WriteLine("-------------------------------------------------------")
        Console.WriteLine(sum & " converted to " & final & curryncy)
    End Sub

End Class

i get this error in this program.
'dTemp' is not a member of 'Decimal'
'out' is not declared. It may be inaccessible due to its protection level
Comma, ')', or a valid expression continuation expected.
'dTemp' is not declared. It may be inaccessible due to its protection level.

yes the dTemp if from c# but i cant figuer out how to change it so it work in vb.net

Recommended Answers

All 2 Replies

This line:

Decimal.dTemp = 0

There shouldn't be a dot there; it tells the compiler to look for a member of Decimal called dTemp .

You meant this:

Decimal dTemp = 0

But that's C#... how about:

Dim dTemp As Decimal = 0

thx for the help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.