Ti89: display text and variable

  • Context: Calculators 
  • Thread starter Thread starter jaredmt
  • Start date Start date
  • Tags Tags
    Text Variable
Click For Summary
SUMMARY

The TI-89 calculator requires the use of the concatenation operator "&" to display both text and a variable on the same line. Users initially attempted to concatenate using the "+" operator, which resulted in incorrect outputs. The correct method involves converting the variable to a string format before concatenation, specifically using the syntax: "the answer is " & string(b). This ensures that the variable is properly displayed alongside the text.

PREREQUISITES
  • Familiarity with TI-89 programming syntax
  • Understanding of string manipulation in programming
  • Knowledge of variable types in TI-89
  • Basic programming concepts related to concatenation
NEXT STEPS
  • Research TI-89 string conversion functions
  • Learn about variable types and their manipulation in TI-89
  • Explore advanced TI-89 programming techniques
  • Study examples of text and variable display in TI-89 programs
USEFUL FOR

Students, educators, and programmers using the TI-89 calculator who need to effectively display text alongside variable values in their programs.

jaredmt
Messages
120
Reaction score
0
with ti89, how can i display both text and variable on the same line?
i tried
Code:
"the answer is " + b
and a bunch of other things but nothing has worked so far

edit:
it said somewhere on tnhe internet that i can do:
Code:
"the answer is " b
but when i run the program all you see is
7 "the answer is "
instead of
the answer is 7
then when go back to edit the code it is automatically set to
Code:
"the answer is "*b
 
Last edited:
Computer science news on Phys.org
I think the TI-89 treats "expA expB" as a request to multiply expA and expB together.

It's been awhile but what I suggest doing is converting b to a string, then adding it to your normal string. So like it would be

"the answer is " + string(b)

"string" may not be the name of the conversion function but there must be some way to go number->string.
 
ok that doesn't work either but i finally did find out. pretty much what you have, except instead of + you have to use &
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
8K
Replies
16
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
4
Views
6K
  • · Replies 34 ·
2
Replies
34
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K