-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConversion.vbs
More file actions
27 lines (24 loc) · 808 Bytes
/
Copy pathConversion.vbs
File metadata and controls
27 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
strInput = InputBox("Do you want to convert a temperature from: " _
& vbCrLf & "1" & vbTab & "Farenheit to Celsius?" _
& vbCrLf & "2" & vbTab & "Celsius to Farenheit?", "Enter a number.")
Select Case strInput
Case "1"
far = InputBox("Enter degrees Farenheit to convert:")
WScript.Echo far & " degrees Farenheit is " _
& Conv2Far(far) & " degrees Celsius."
Case "2"
cel = InputBox("Enter degrees Celsius to convert:")
WScript.Echo cel & " degrees Celsius is " _
& Conv2Cel(cel) & " degrees Farenheit."
Case Else
WScript.Echo strInput & " is an invalid value."
WScript.Quit
End Select
Function Conv2Far(cel)
cel = (far - 32) * .6
Conv2Far = cel
End Function
Function Conv2Cel(far)
far = (cel * 1.8) + 32
Conv2Cel = far
End Function