For:TI 84+ (and TI83)
Code:Basic
Basics: Synthetic Division program

Just to start off I would like to let you all know that i am a complete novice, just starting out in programming... I am trying to learn, and my first few programs are nothing more than me figuring out the ropes

Basically this is a program that can synthetically divide, I made it because that is one of the current things I am learning, although it is very easy to do, I thought it would be a good way to practice some skills.

Basically it starts by asking whether you want to start the program or to view the readme, the actual program starts by prompting R which is what you wish to divide by, then continues by prompting B and C. a C value has been entered and the enter key pressed, the program pauses and waits for either the + key or CLEAR to be pressed. the + key prompts another variable, the CLEAR key stops prompting and calculates, I added this feature mainly to practice and learn about getkey but it allows for any number of variables to be used. The program finishes by outputting all the

if anyone has any recommendations based on the program PLEASE let me know, i realize i most likely messed up several times, as well as had a LOT of redundant code... I do plan to also have it do a positive and negative at the same time, but i will wait untill i have the coding down till I do that

so here is the program:

http://www.mediafire.com/?ml7nfc4b348dc75 - .zip of .8xp files

Actual program - http://sc.cemetech.net/?xpi=2dd119fbebebc3706d763100a535efad

sub program called synth - http://sc.cemetech.net/?xpi=5a4a91dbd709189037e3295ac43be7dc

There are two programs included in the .zip folder, 1 called synthy and another called synth, synthy is the actual program, but you need synth to make it work

feel free to use the program, it does work 100% i have tested a number of times on different equations. Again, any feedback is great! one of my first programs (that actually does something usefull) but i plan on making some more and helping out this community out as much as i can as soon as i learn a bit more!

by the way sorry for the double post, bit of a technical issue :O
Umm.. You really should look at what SourceCoder has to say about your program.

You have no Ends there. This program will crash so hard due to memory leaks it's not even funny.
tifreak8x wrote:
Umm.. You really should look at what SourceCoder has to say about your program.

You have no Ends there. This program will crash so hard due to memory leaks it's not even funny.

I was planning on fixing everything sourcecoder told me to, since it knows more than me Razz
Well, feel free to post up here with questions, we'll be more than happy to help repair your program to make it more efficient and as small as it can be.
tifreak8x wrote:
Well, feel free to post up here with questions, we'll be more than happy to help repair your program to make it more efficient and as small as it can be.

thanks! right now, I am more concerned with just making my programs work, and work well. Of course i would like to make the programs as good as they can be, however, as a total noob keeping it small isn't my biggest concern.

one question, did you see any other way of making it so that it will let you only put in as many variables as you want? i want the user to be able to put in multiple variables, but not a set amount... the getkey was the best solution i could figure out
There are easier ways to set that up. For example mine has X^6 automatically and then you just input zero for unwanted numbers. Also it solves to the simplest form. Then if possible can do the quadratic equation. Here is the code if you wish to see

Also Lists would be the only way to do that. I am not sure exactly how that would work as I am still learning lists.
Aes_Sedia5 wrote:
There are easier ways to set that up. For example mine has X^6 automatically and then you just input zero for unwanted numbers. Also it solves to the simplest form. Then if possible can do the quadratic equation. Here is the code if you wish to see

Also Lists would be the only way to do that. I am not sure exactly how that would work as I am still learning lists.

but doesn't that only work with equations of degree 6? or does it work with others? and if so... how?
That does only work with degree 6 or less. If you have a degree 3 Then put 0 in for degree 4-6. It solves the same but it displays 3 zeros then the answer. It is a bit different now but same principle.
Aes_Sedia5 wrote:
That does only work with degree 6 or less. If you have a degree 3 Then put 0 in for degree 4-6. It solves the same but it displays 3 zeros then the answer. It is a bit different now but same principle.

but with synthetic division won't those zeroes effect the final answer? or wont it... I am going to have to test this to double check, if it works, i am going to be sorely dissapointed as you did what i wanted to in about 1000000 less lines of code Mad
Yup. The zeros make no affect on it at all. I tested it several times.
Aes_Sedia5 wrote:
Yup. The zeros make no affect on it at all. I tested it several times.

AAARRRGHHHH you're correct!

well, i still feel pretty good since my program at least works :/ plus i was mainly doing this to test out the getkey function in a semi-useful program
Another way to learn getKey would be to make a Text( getKey Menu. Here is an example.

Code:

:ClrHome
:ClrDraw
:Text(1,1,"AREAANDVOLUMEANDSURFACEAREAS
:Text(7,1,"1.FINDFORARC-LENGTH
:Text(13,1,"2.FINDFORCIRCLE
:Text(19,1,"3.RIGHTCIRCLECONE
:Text(25,1,"4.RIGHTCIRCLECYLINDER
:Text(31,1,"5.FINDFORRECTANGLEPRISM
:Text(37,1,"6.FINDFORRIGHTPYRAMID
:Text(43,1,"7.MORESHAPES
:Text(49,1,"8.EXIT
:Text(55,1,"MADEBYAESSEDIA5CEMETECH.NET
:Repeat K
:getKey→K
:End
//Then If K=whatever then execute that code.
Aes_Sedia5 wrote:
Another way to learn getKey would be to make a Text( getKey Menu. Here is an example.

Code:

-snip-

Surprised I didn't think of doing something like that, I will have to use that for the next program i make... thanks for the advice and help!
No problem. If you need anything else just let us know.
These things:
Code:
:RB+C→C
:CR+D→D
:DR+E→E
:ER+F→F
:FR+G→G
:GR+H→H
:HR+I→I
:IR+J→J
:JR+L→L
:LR+M→Z
:XB+C→N
:NX+D→O
:OX+E→P
:PX+F→Q
:QX+G→S
:SX+H→T
:TX+I→U
:UX+J→V
:VX+L→W
:WX+M→Y
We really, really, really, really need to teach you how to use lists. That sort of code makes me just the saddest.
I am not sure how to use lists for that either.
That could easily be done in a simple seq() statement if the variables C-Y were replaced with a 23 element list.
Ok I will try to get that working . thanks souvik
Consider L1={B,C,D,E,F,G,H,I,J,K,L,M}, where the letter variables are not really in this list, but the list elements are representative of the respective values that you want to work with.

Then, this...

Code:
:BR+C→C
:CR+D→D
:DR+E→E
:ER+F→F
:FR+G→G
:GR+H→H
:HR+I→I
:IR+J→J
:JR+L→L
:LR+M→M
(Not your actual code)


...is equivalent to this:

Code:
augment({L1(1)},seq(L1(T)R+L1(T+1),T,1,11→L1
KermMartian wrote:
These things:
Code:
-snip-
We really, really, really, really need to teach you how to use lists. That sort of code makes me just the saddest.

Could you perhaps point me towards a basic tutorial on lists? i tried figuring them out on my own, but with little to no success...

also, weregoose, i have NO idea what that means, or would do from just looking at it

Code:
augment({L1(1)},seq(L1(T)R+L1(T+1),T,1,11→L1
  
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
Page 1 of 3
» 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