Re: Grades Program
[Prev][Next][Index][Thread]
On 09/30/96 18:29, MICHAEL J COCCARO muttered something stupid about Grades
Program
>I am attempting to write a program of the TI-85 that will keep track of g
>I would like the program to allow the user to enter a description of the
>assignment. I don't know how to se up a "standard" process of Entering s
>variables. For example:
>Input "Title: ", T
You'll want to change this to "InpSt "Title: ",T ", to keep T a string.
>Input "Points: ",P
>Input "Possible: ",PP
>Is there a way that I can have a program refer to that sub function of th
>program whenever a new assignment is to be entered. My BIG problem, is
>it record the variables "T", "P", and "PP" so that each time a new assign
>is to be entered, the previous assignment values are not overwritten. I
>there a way to have it generate variable names automatically? Does this
>any sense? Please respond. Thanks.
>Michael Coccaro
The best way to call subroutines is making another program, in your case with
data input commands (ie Input, and InpSt).
In order to not overwrite prev. entries, make the real #s into a list, and
concatenate your strings into a single one with a marker in between entries
to break it up (ie, if there are three entries, the concatenated string might
look like "QUIZ1|QUIZ2|TEST1|", where "|" is the separator.)
To add your reals to a list, use something like the following:
:P -> POINTS(dimL POINTS+1) ;Adds P to the end of list POINTS
:PP -> POSS(dimL POSS+1) ;Adds PP to end of list POSS
To figure averages, use
:(sum POINTS)\(sum POSS) -> X ;Finds the average, and stores it in X
To concatenate the strings into a string called NAMES, do
:NAMES+T+"|" -> NAMES ;Also adds separator "|"
To recall concatenated strings, you need to search through the string, and
find all the separators ("|"). This can be done with a slow search program I
wrote. As I said, it can be slow...
:For(X,1,lngth NAME
:If sub(NAMES,X,1)=="|":then ;Checks for "|"
: <INSERT ACTION HERE> ;Do what you want
:end ;End of If..Then.. statement
:end ;End of For( loop
As I said, on big strings, this can take a while. If anyone has any faster
algorithm, I would appreciate it if it was posted to this list.
I hope I helped in some way.
--====--
[(.)(.)]
------oOOo---()-----oOOo--------
Rob Linwood - Technicolor Dragon
-=<UDIC>=- - -~-(UDHISS)-~-
rob.linwood@k-palace.com
<pre>
---
* PW * The world is coming to an end... SAVE YOUR BUFFERS!!!
</pre>
References: