Advertisement
gnamp

Small Basic Temperature Conversion

Aug 1st, 2012
3,179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. start:
  2. TextWindow.Write("Fahrenheit to Celcius? (Type 1) or Celcius to Fahrenheit? (Type in 2): ")
  3. selection = TextWindow.Read()
  4. If selection = "1" Then
  5. TextWindow.Write("Enter temperature in Fahrenheit: ")
  6. fahr = TextWindow.ReadNumber()
  7. celsius = 5 * (fahr-32) / 9
  8. TextWindow.WriteLine("Temperature in Celcius is " + celsius)
  9. Else
  10. TextWindow.Write("Enter temperature in Celcius: ")
  11. celsius = TextWindow.ReadNumber()
  12. fahr = (celsius * 9/5) + 32
  13. TextWindow.WriteLine("Temperature in Fahrenheit is " + fahr)
  14. EndIf
  15. TextWindow.Write("Go again? y/n : ")
  16. repeatchoice = TextWindow.Read()
  17. If repeatchoice = "y" Then
  18.   Goto start
  19.   Else
  20.   EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement