3 hours ago
I am trying to get good at writing simple code that is easy to read. I took up that assignment of writing a Inches to millimeters conversion calculator in Lesson 2 of the tutorial. All I am asking is is there any way to improve my code? I added the option to convert to millimeters to inches.
Thanks for any feedback!
Code: (Select All)
Dim inches# 'container for inches
Dim op% 'which operation (either in to mm or mm to in
Dim mm# 'container for mm
Const Conv# = 25.4 '25.4 mm every inch
Print "1. mm to in"
Print "2. in to mm"
Input "Please enter the operation you would like to do. > ", op%
If op% = 1 Then
Input "Enter mm >", mm#
Print mm# / Conv#
ElseIf op% = 2 Then
Input "Enter Inches", inches#
Print inches# * Conv#
Else
Print "No Op..."
End If
Thanks for any feedback!