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()
    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
        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(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

5 Years
Discussion Span
Last Post by Kalle21

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

Edited by gusano79: missed the VB/C# thing

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.