Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curious if I am thinking about this right.
#1
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. 

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!
Reply


Messages In This Thread
Curious if I am thinking about this right. - by protocog - 7 hours ago



Users browsing this thread: 10 Guest(s)