home *** CD-ROM | disk | FTP | other *** search
/ Game Programming for Teens / GameProgrammingForTeens.iso / Source / chapter03 / demo03-06.bb_bak1 < prev    next >
Encoding:
Text File  |  2003-04-06  |  519 b   |  21 lines

  1. ;demo03-06.bb - Converts Fahrenheit to Celsius
  2.  
  3. ;MAIN PROGRAM
  4. Print "Welcome to our FtoC converter" 
  5. ;get fahrenheit and put it in fvalue
  6. fvalue = Input$("What Fahrenheit value do you wish to convert?")
  7.  
  8. ;Convert fvalue to Celcius
  9. cvalue = ConvertFtoC(fvalue) 
  10.  
  11. ;print results
  12. Print fvalue + " Fahrenheit = " + cvalue + " Celsius." 
  13.  
  14. ;Wait for user to press a kye
  15. WaitKey
  16. ;END OF MAIN PROGRAM
  17.  
  18. Function ConvertFtoC(fvalue) 
  19.     ;convert value and return it
  20.     Return 5.0/9.0 * (fvalue - 32)
  21. End Function