TIB: Re: TI-89 Basic question


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

TIB: Re: TI-89 Basic question




you can't combine numbers and letters like that.  try:

disp "y="&string(m)&"x+"&string(b)

you have to convert the variables m and b into strings, which is done
by string().  and to display several strings together, you have to use
&.

----- Original Message -----
From: <TerrisUS@aol.com>
To: <ti-basic@lists.ticalc.org>
Sent: Thursday, March 23, 2000 4:22 PM
Subject: TIB: TI-89 Basic question



ok, im writing a small program (pasted at the end of this email),
which all
it does is, given 2 sets of points, calculates the slope, solves for
b, and
puts the equation into y=mx+b form (with y and x remaining as
variables, and
m being replaced with the slope as a fraction, and b being replaced by
the
value it was solved for).
and the part of it that finds the slope works fine. however,
converting it
into y=mx+b is another story. if I input into the program 2 (for x), 3
(for
y), 7 (for xx, or x2 if you will) and 7 (for yy, or y2), it gives me a
slope
of "4/5" (which is correct), but for the 2nd part, transforming it
into
y=mx+b form (and ive tried it just solving for b, and displaying that,
so
that isnt the problem), it says "y=(b+mx=3)"". what it should say in
that
case is "y=4/5x+7/5" (i believe i did that math out right. in any
event, you
get the idea). anyone know why it isn't displaying the y=mx+b part
anywhere
near right?

(ok, program is below) (the » is the store key by the way) (oh, and
the final
display equation says "y=mx+c", but it's just c because that's what i
stored
the answer for "b" as. as i said above, it should say y=[num]x+[num],
whith
[num] being a number and the other variables just displaying themself)

()
Prgm
Prompt x,y,xx,yy
(yy-y)/(xx-x)»m
Disp "Slope is"
Disp m
solve(y=mx+b,b)»c
Delvar x
Delvar y
Disp y=mx+c
EndPrgm







__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com



References: