The program STRNAMES allows the user to store a list of names in a single string. There are only 10 string variables for the TI-84 Plus CE (and in fact, all the the TI-83 and TI-84 families), so if you need to store more than 10 names, a workaround is needed.
This program uses two strings: Str1 and Str2. Str1 is a temporary string variable used to store and edit the list of names. Str2 is the master list of all the names.
In order to make this work, we will need to note where in the string the names start and the length of the names. The two lists used are L₁, the position of each name, and L₂ for the length of each name.
In this program, each name is separated by space.
You will notice that Str2 starts with a space, and the lists L₁ and L₂ have a 0. The TI-84 Plus CE does not allow us to store empty strings or lists.
STRNAMES The Menu
1. Add a Name: Add a name to the list
2. Delete Last Name: Deletes the last name on the list
3. Clear/Initialize: Clears all the variables. I recommend you start with this option every time you work with a new list of names. Also, if you use other programs or the list or strings for other things, run the Clear/Initialize before beginning.
4. Review: List all the names in order.
5. Erase Any Name: You can erase any name in the list (1st name, 2nd name, 3rd name, etc).
6. Exit: Quits the Program
TI-84 Plus CE Program STRNAMES
Menu(“MENU”,”ENTER A NAME”,A,”DELETE LAST NAME”,B,”CLEAR/INITIALIZE”,C,”REVIEW”,D,”ERASE ANY NAME”,E,”EXIT”,F)
Input “NAME: “,Str1
Disp “LIST IS EMPTY.”
Input “ENTRY NUMBER:”,I
Disp “END PROGRAM”
Try playing with this program.
1. Start by initializing, choose option 3.
2. Enter EDDIE. Choose option 1. Press [ 2nd ] [alpha] and type EDDIE. Quotes are not needed (since the Input command will be stored to a string). Str2 = ” EDDIE “
3. Enter ANN. Choose option 1. Str2 = ” EDDIE ANN “
4. Enter TERRY. Choose option 1. Str2 = ” EDDIE ANN TERRY “
5. Let’s remove ANN from the list. In our example, ANN is the second name. Choose option 5. Enter 2. The result, Str2 = ” EDDIE TERRY “
6. Enter MARK. Choose option 1. Str2 = ” EDDIE TERRY MARK “
7. Review the list of names. Choose option 4. The screen will show:
Continue with the example however you want.
All original content copyright, © 2011-2018. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. Please contact the author if you have questions.