I Have To Write A Pseudo Code For A Unit Converter. I Have Written The Program Already But I've Not Really Written One Before. It Converts Miles To KM:
Dim DataIn As Single
Dim DataOut As Single
Dim ConversionType As String
Const M2KCoefficient As Single = 1.6
Private Sub UserForm_Activate()
Call ResetParameters
End Sub
Sub ResetParameters()
'set the default conversion type
OptionButton1.Value = True
UserForm1.Caption = "Unit Convertor"
End Sub
Private Sub CommandButton1_Click()
Call ReadData
Call DetermineConversionType
Call ProcessData
Call OutputData
End Sub
Sub ReadData()
DataIn = Val(Txt_imput.Text)
End Sub
Sub DetermineConversionType()
If OptionButton1.Value = True Then
ConversionType = "km2miles"
ElseIf OptionButton2.Value = True Then
ConversionType = "miles2km"
End If
End Sub
Sub ProcessData()
Select Case ConversionType
Case "miles2km"
DataOut = DataIn * M2KCoefficient
Case "km2miles"
DataOut = DataIn / M2KCoefficient
End Select
End Sub
Sub OutputData()
Lbl_output.Caption = DataOut
End Sub
Pretty Easy, I Know, I Understand ALL OF THIS! BUT NOT HOW TO WRITE THAT PSEUDOCODE! PLEASE HELP!