I am on this exercise Binary in Visual Basic on Exercism
and the editor sugests this solution structure:
-
Public Class Binary
-
Public Sub New(value As String) -
Throw New NotImplementedException("You need to implement this function") -
End Sub -
Public Function ToDecimal() As Integer -
Throw New NotImplementedException("You need to implement this function") -
End Function -
End Class
The input is suposed to be a binary in string form.
fair enough.
And the conversion should be pretty straightforward with iteration over the converted integer with the help of modulo.
What I dont get is how I am supposed to use the Sub method and the toDecimal function together ?.. Should I put a member variable in the class Binary maybe or what do u suggest ?
Thanks in advance