home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming for Teens (2nd Edition) / 3DGPFT2E.iso / Source / Chapter03 / demo03-06.bb < prev    next >
Encoding:
Text File  |  2009-01-21  |  515 b   |  22 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. ;Delay five seconds
  15. Delay 5000
  16.  
  17. ;END OF MAIN PROGRAM
  18.  
  19. Function ConvertFtoC(fvalue) 
  20.     ;convert value and return it
  21.     Return 5.0/9.0 * (fvalue - 32)
  22. End Function