RE: TIB: TIB prgm


[Prev][Next][Index][Thread]

RE: TIB: TIB prgm




This program isn't necessary on the TI-83 because of the built-in
days-between-dates function that someone else pointed out, but in case
somebody uses this on another calculator, I just wanted to say that better
values in this program for the average lengths of months and years are
365.25 and 30.4375. These were calculated with the following formula:

31*7+30+4+28.25 = 365.25

365.25/12 = 30.4375

-----Original Message-----
From: owner-ti-basic@lists.ticalc.org
[mailto:owner-ti-basic@lists.ticalc.org]On Behalf Of Ted21@aol.com
Sent: Friday, September 03, 1999 3:30 PM
To: ti-basic@lists.ticalc.org
Subject: Re: TIB: TIB prgm



This should do it-
;********************
ClrHome
Disp "Birthdate"
Input "Year: ",D
Input "Month: ",E
Input "Day: ",F
ClrHome
Disp "Today's Date"
Input "Year: ",G
Input "Month: ",H
Input "Day: ",I
ClrHome
I - F \->\ C
If C < 0
Then
C + 30.5 \->\ I
H - 1 \->\ H
End
H - E \->\ B
If B < 0
Then
B + 12 \->\B
G - 1 \->\ G
End
G - D \->\  A
A * 364.25 + B * 30.5 + C /->/C
int(C+.05) /->/ C
Output(1,1,"Days: ")
Output(1,7,C)
Pause
ClrHome
;*************************
I didn't actually try it, so if this doesn't work, let me know, and I'll
help
you out.  I think that the code is straightforward enough, but if anything
needs to be clarified, send me another message.

Ted





References: