WINDCHIL.BAS - Part I

 BBS: Inland Empire Archive
Date: 02-25-93 (12:55)             Number: 326
From: RICHARD BASH                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: WINDCHIL.BAS  - Part I         Conf: (2) Quik_Bas
'           WINDCHIL.BAS
'
'           COMPUTES WINDCHILL EQUIVALENT TEMPERATURE (W.E.T.)
'
'          旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커
'                  THIS PUBLIC DOMAIN PROGRAM WAS WRITTEN BY   
'                                                              
'                          RICHARD M. BASH                     
'                      c/o COMBAT ARMS BBS                     
'                          P.O. BOX 913                        
'                          PORTLAND, OREGON 97207-0913         
'                          VOICE: (503) 223-3160               
'                                                              
'                          24 HOUR BULLETIN BOARD IN OPERATION 
'                300/1200/2400/4800/7200/9600/12000/14400 bps  
'                          FIREARMS, MATH, SCIENCE, & LAW FILES
'                          BBS PHONE: (503) 221-1777           
'                                                              
'          읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸
'
'
'             REVISED ON 02/25/93 TO CORRECT THE INSTALLATION OF
'             A NEW MODEM ON THE BBS AND PRESENT TO THE QWIK_BAS
'             FIDO ECHO.
'
'         袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴敲
'          THIS PROGRAM IS BASED UPON DATA FROM:               
'          PAGE 323 OF WEATHERWISE MAGAZINE, DECEMBER, 1987    
'          ALL RIGHTS TO THE ORIGINAL DATA DISPLAYED IN        
'          WEATHERWISE MAGAZINE REMAIN WITH THE PUBLISHERS OF  
'          WEATHERWISE.                                        
'         훤袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴袴
'
'          CLEAR ALL VARIABLES, CLEAR SCREEN, TURN KEY OFF,
'          SELECT SCREEN 0, AND SET COLOR TO HALF INTENSITY
'          CHARACTERS.
'

StartHere:

CLEAR : KEY OFF: SCREEN 0: COLOR 14, 4: CLS
Q1$ = "COMBAT ARMS BBS"
Q2$ = "- WIND CHILL FACTOR CALCULATION -": DEFDBL A-Z

'   LET Q1$ EQUAL THE FIRST LINE OF THE HEADING AND Q2$ EQUAL THE
'   SECOND LINE OF THE HEADING.

'   DETERMINE WHERE ON SCREEN HEADINGS SHOULD GO.  Q1 IS THE
'   COLUMN POSITION FOR THE FIRST LINE OF THE HEADING AND Q2
'   IS THE COLUMN POSITION FOR THE SECOND LINE OF THE HEADING.

Q1 = (80 - LEN(Q1$)) / 2: Q2 = (80 - LEN(Q2$)) / 2

'   PUT THE SYSTEM DATE IN A USEABLE FORMAT (MM/DD/YY).

D$ = MID$(DATE$, 1, 2) + "/" + MID$(DATE$, 4, 2) + "/" +
MID$(DATE$, 9, 2)

'   DISPLAY HEADINGS AND OVERLAY TO USER

LOCATE 5, 21: PRINT CHR$(201) + STRING$(37, 205) + CHR$(187);
LOCATE 6, 21: PRINT CHR$(186) + STRING$(37, 32) + CHR$(186);
LOCATE 7, 21: PRINT CHR$(186) + STRING$(37, 32) + CHR$(186);
LOCATE 8, 21: PRINT CHR$(186) + STRING$(37, 32) + CHR$(186);
LOCATE 9, 21: PRINT CHR$(186) + STRING$(37, 32) + CHR$(186);
LOCATE 10, 21: PRINT CHR$(186) + STRING$(37, 32) + CHR$(186);
LOCATE 11, 21: PRINT CHR$(200) + STRING$(37, 205) + CHR$(188);
LOCATE 1, Q1: PRINT Q1$: LOCATE 2, Q2: PRINT Q2$
LOCATE 7, 25: PRINT "THERMOMETER READING (F.)   ..."
LOCATE 9, 25: PRINT "WIND VELOCITY (m.p.h.)      ..."

'          DISPLAY SYSTEM DATE AND TIME

LOCATE 19, 21: PRINT CHR$(218) + STRING$(37, 196) + CHR$(191);
LOCATE 20, 21: PRINT CHR$(179) + STRING$(37, 32) + CHR$(179);
LOCATE 21, 21: PRINT CHR$(179) + STRING$(37, 32) + CHR$(179);
LOCATE 22, 21: PRINT CHR$(192) + STRING$(37, 196) + CHR$(217);
LOCATE 20, 27: PRINT "Today's date is "; : COLOR 15, 4
PRINT D$
COLOR 14, 4
LOCATE 21, 24: PRINT "The system time is "; : COLOR 15, 4
GOSUB TimeConvert: PRINT T7$
COLOR 14, 4: LOCATE 13, 21
PRINT "Enter END at temperature prompt to exit"

'  INPUT THE ACTUAL OUTSIDE AIR TEMPERATURE (IN  FAHRENHEIT).

GetTemp:

COLOR 15, 4: LOCATE 7, 53: INPUT "", TEMP$

'          IF USER INPUTS ENDING INFO THEN QUIT

IF TEMP$="E" OR TEMP$="e" OR TEMP$="END" OR TEMP$="end" THEN GOTO
ByeScreen

IF TEMP$ = "" OR VAL(TEMP$) = 0 THEN COLOR 14, 4: LOCATE 7, 25:
PRINT SPACE$(34): LOCATE 7, 25: PRINT "THERMOMETER READING (F.)
...": GOTO GetTemp

TEMP = VAL(TEMP$): TEMP = INT(TEMP)

IF TEMP < -99 OR TEMP > 40 THEN COLOR 15, 4: LOCATE 13, 1: PRINT
SPACE$(80): LOCATE 13, 19: BEEP: COLOR 15, 4: PRINT "TEMPERATURES
MUST BE BETWEEN +40F AND -99F"

IF TEMP < -99 OR TEMP > 40 THEN LOCATE 7, 25: COLOR 14, 4: PRINT
"THERMOMETER READING (F)    ...": GOTO GetTemp

'    INPUT THE ACTUAL WIND VELOCITY (IN MILES PER HOUR).

GetWind:

LOCATE 9, 53: COLOR 15, 4: INPUT "", WIND$

IF WIND$ = "" OR VAL(WIND$) = 0 THEN COLOR 14, 4: LOCATE 9, 1:
PRINT SPACE$(80): LOCATE 9, 25: PRINT "WIND VELOCITY (m.p.h.)
...": GOTO GetWind

WIND = VAL(WIND$): WIND = INT(WIND#)

IF WIND < 4 OR WIND > 50 THEN COLOR 15, 4: LOCATE 13, 1: PRINT
SPACE$(80): LOCATE 13, 20: PRINT "ONLY WINDS FROM 5 TO 50 m.p.h.
ARE VALID": BEEP

IF WIND < 4 OR WIND > 50 THEN LOCATE 9, 25: PRINT SPACE$(34):
LOCATE 9, 25: COLOR 14, 4: PRINT "WIND VELOCITY (m.p.h.)
...": GOTO GetWind

'    FORMULA FOR DETERMINING WINDCHILL EQUIVALENT TEMPERATURE
'    (WET) BASED ON THE WORK OF PAUL SIPLE AND CHARLES PASSEL.
'    SEE THE ARTICLE DISCUSSING THIS ON PAGE 323 OF THE DECEMBER,
'    1987 ISSUE OF `WEATHERWISE' MAGAZINE.

WET = 91.4-(.474+(.303*SQR(WIND)) - (.02 * WIND)) * (91.4 - TEMP)

'         DISPLAY THE WINDCHILL EQUIVALENT TEMPERATURE

LOCATE 13, 1: PRINT SPACE$(80)
COLOR 14, 4: LOCATE 13, 17
PRINT "THE WINDCHILL EQUIVALENT TEMPERATURE IS "; : COLOR 15, 4
PRINT USING "####."; WET; : PRINT "F": COLOR 14, 4


         -= THIS PROGRAM CONTINUED IN THE NEXT MESSAGE =-


--- WM v2.04/91-0172
 * Origin: Combat Arms BBS - Portland, OR - (503) 221-1777 (1:105/68)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET