Ok I am fairly new to programming. Pretty much just taught myself everything I know which i think is quite a bit in basic.

So now i need to save a table into a list. Is there any way to do that? I need it for my calculus teacher. He wants to take an equation and add all the values for say 28 partitions without using another calculator to look at the table and add it all.

Also if I save an equation in Y1 and then use Y1 in a program will the value of X still be put into the equation in Y1?

Ex.

Code:
Menu("Are you using","Triangle",B,"Circle",C,"Exit XX)
Lbl XX
Return
lbl B
Sqrt3)*4store Z
Goto theta
Lbl C
pi/8 store Z
goto Theta

Lbl Theta
Input "Function:          ",str1
str Store to Y1
Input "Thickness of shape",A
             Lets say  is 1
Input "Length Of Shape",L
            Length = 6
0store X
0 store T
C store 0
Repeat C=L
X+.001
Z*Y1*A store B
B+Tstore T
C+.001store C
End


Would The Y1 function be effected by the X variable or would I need to manually edit the program with the new formula everytime i need to change it.
FYI. This is for calculus also. It is for finding the volume of a non normal shape.

Thanks in advance for all the help.

ps. This is in no way a finished program. I just came up with it on the top of my head so it might be a little off or unfunctional. Hopefully you can tell what i mean.
It's great to have you with us; two points of administrative detail:
1) Please put code inside [code] tags; it makes it much easier to read.
2) You can use SourceCoder 2.5 to turn .8xp files into source code, nicely formatted and everything, so that you don't have to type it out.

Now, on to answering your questions.
Quote:
Also if I save an equation in Y1 and then use Y1 in a program will the value of X still be put into the equation in Y1?
You can make it so, but of course you need to not modify X. The slightly rephrased answer is "you can plug X values into YN equations from BASIC programs".
Quote:
would I need to manually edit the program with the new formula everytime i need to change it.
Absolutely not.
Ok So my new code is So Far it seems to work.


Code:

input "Height Formula",str1
str1 sto Y1
input "Lower bound forumula",str2
str2 sto Y2
Input "thickness of shape",B
Input "Left Bound",P
Input "Right Bound",Q
abs(Q-P)sto L
Input "Number Of Partitions",N
L/N sto V
0 sto X,T,C
Repeat C=L
X+Vsto X
               'Z Equals the formula of the shape.
Repeat C=L
Z*(y1-y2)^2 *B sto U
U+T sto T
C+V sto C
End
Disp T
Pause.


Would This work?


PS. Is there anyway to download that code parser to use on my pc. I only have internet access through my school so programming is a little difficult. And ti Program Editor doesnt read 3 quarters of my programs. It always has a tag error of some sort.

pps Thanks for the Code tag. I totally forgot about that.
The closest you can download is Tokens, which is by Merthsoft. (look in the featured members sub-forum on the index page)

Otherwise, using Source Coder online is the only other best option.
My site is currently down, unfortunately. Tifreak, do you have a copy hosted somewhere?
Yes, it is on the very first post, I posted an alternate link for downloading.
Thanks that is good to know. If no one has a hard copy somewhere then i will just wait for the side to get back up and running. THanks again.

Does anyone know how to save a table
into a list?
You can't use StrN->YN; you have to use the String>Equ( command instead. Once you do that, you simply set X (and/or any variables) and wherever you use YN, the calculator will evaluate YN given the current X and return that value (by YN, I of course mean Y1, Y2, etc).
http://tifreakware.net/merthsoft/Tokens.zip Here's the link to it Smile
And to continue to persevere to keep this on topic, I'll make what would otherwise be a double-post, and ask what you mean by saving a table to a list. Perhaps something like this?


Code:
20->dim(LVALS
For(X,0,19
Y1->LVALS(X
End


This will evaluate Y1 for X=0 through X=19, and store the results in 20 elements of list LVALS
Ya that would probably do it. So they only way would be to make a program using it. Good to know. Thanks. My Calculus teacher basically wanted to take the table and sum it all together like a list sum. So i will let him know that this is how u do it.
Aes_Sedia5 wrote:
Ya that would probably do it. So they only way would be to make a program using it. Good to know. Thanks. My Calculus teacher basically wanted to take the table and sum it all together like a list sum. So i will let him know that this is how u do it.
It sounds like you want to do an integral approximation of some sort, perhaps? If so, then putting the elements in a list first is probably not the most efficient. Smile
Then what would you recommend.
Basically what we are doing is raimuns sum. (Not sure I spelled right)
But we are taking the volume of say an object with a sin wave on the top and a flat bottom and taking the equation that we made for that and put that into Y1 to graph it and then we add the table of values to get the volume of all the partitions to find the volume of the structure. The Program you gave me would probably work.

I have calculus today so I will show the teacher and see if it would work.

Ok this Is the final Product of that code you gave me.


Code:

Disp " Lower bound"
Input "Of the List",A
Disp "Upper bound"
Input "Of the List",B
B->Dim(LVAL)
For(X,A,B)
Y1 ->LVAL(X)
sum(LVAL)
Reimann's sum, I believe. Are you doing left-side, right-side, or center? Basically, you should do something like this:


Code:
:Input "Y=",Str1
:String>Equ(Str1,Y1
:Input "X1=",A
:Input "X2=",B
:Input "delta X=",C
:0->Z //total
://This line for left-side:// :For(X,A,B-C,C
://This line for right-side:// :For(X,A+C,B,C
://This line for center:// :For(X,A+.5C,B-.5C,C
:Z+C*Y1->Z
:End
:Disp "TOTAL AREA:",C


Edit: Just from a first glance, your For loop is missing an End.
basically right now i have That but i have a few more inputs and I am using a repeat loop instead of for loops. I have not done much work with for loops. I will upload my code either today or monday if I can and see If it would work.
Aes_Sedia5 wrote:
basically right now i have That but i have a few more inputs and I am using a repeat loop instead of for loops. I have not done much work with for loops. I will upload my code either today or monday if I can and see If it would work.
OK, I look forward to seeing what you come up with. In many cases a Repeat/While loop would be a good idea; here I think a For loop makes much more sense, personally.
Ok this is my program code.

Code:

:DelVar ABCDEFGHIJKLMNOPQRSTUVWXYZθ
:Normal
:Float
:a+bi
:AxesOn
:MATHPRINT
:Lbl ST
:Menu("CALCULUS","REIMUNS SUM",A,"TRIGONOMETRY",Z,"EXIT",XX)
:Lbl XX
:Return
:
:
:
:
:
:Lbl A
:Menu("USE","SQUARE",AA,"TRIANGLE",AB,"CIRCLES",AC,"BACK",ST,"EXIT",XX)
:Lbl AA
:1→Z
:Goto Y
:Lbl AB
:√(3)*4→Z
:Goto Y
:Lbl AC
:π/8→Z
:Goto Y
:Lbl Y
:Input "HEIGHT FORMULA",Str1
:String►Equ(Str1,Y1
:Input "LOWER BOUND FORMULA",Str2
:String►Equ(Str2,Y2)
:Input "THICKNESS OF SHAPE",B
:Input "LEFT BOUND",P
:Input "RIGHT BOUND",Q
:abs(Q-P)→L
:Input "NUMBER OF PARTITION",N
:L/N→V
:0→X
:0→T
:0→C
:Lbl θ
:Repeat C=L
:¦ X+V→X
:¦ Z*(Y1-Y2)2*B→U
:¦ U+T→T
:¦ C+V→C
:End
:Disp "RIGHT EDGE SUM",T
:Pause
:0→X
:0→C
:0→S
:Repeat C=(L-1)
:¦ X+V→X
:¦ Z*(Y1-Y2)2*B→U
:¦ U+S→S
:¦ C+V→C
:End
:Disp "LEFT EDGE SUM",S
:Pause
:(T+S)/2→K
:Disp "TOTAL VOLUME",K
:Pause
:Goto ST
:
:
:
:
:Lbl Z
:Asm(prgmZZARCHIV
:UnarchiveprgmTRIGONOM
:prgmTRIGONOM
:ArchiveprgmTRIGONOM
:Asm(prgmZZARCHIV


The TRIGONOM program is just everything I made for the entire Year of trig and the ZZARCHIV allows you to archive and unarchive from within a program.

Anyway there it is.
That first Delvar statement wouldn't work, you need to put Delvar before each variable you want to delete.
Oh. Good to know. Its all ways worked for me before. Or so I thought. Does adding a comma inbetween every variable work?


Code:

delvar A,B,C etc.
No, you need to do Delvar ADelvar BDelvar C, etc.
  
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
» Goto page 1, 2, 3 ... 10, 11, 12  Next
» View previous topic :: View next topic  
Page 1 of 12
» 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

 

Advertisement