So I have been trying to make a program to factor any polynomial expression by inputting a string. When making the code to check to see if I can factor out an X, I got stuck when I realized there must be a way to individually change one letter of a string. Is this possible?
Yes; the option I can think of right now is to cut the string into two pieces using substrings, add in the character, and reassemble the string, as in this pseudocode:
TI-83 series - :sub(string,1,position-1)+yourstring+sub(string,position+1,length(string)-position
TI-89 series - :left(string,position-1)&yourstring&right(string,position+1)
This will error out if the position is 1 or length(string); it only works for characters that are not the first or last.
TI-83 series - :sub(string,1,position-1)+yourstring+sub(string,position+1,length(string)-position
TI-89 series - :left(string,position-1)&yourstring&right(string,position+1)
This will error out if the position is 1 or length(string); it only works for characters that are not the first or last.
- Yackback
- Newbie (Posts: 22)
- 25 Jun 2014 05:20:39 am
- Last edited by Yackback on 25 Jun 2014 05:22:24 am; edited 1 time in total
im on ti 84.
Thanks, I prob coulda thought of that given enough time
Thanks, I prob coulda thought of that given enough time
CVSoft wrote:
The TI-84 Plus series is a member of the TI-83 series, and thus the above code will work.
IK that.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement