Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
rohi89


Newbie


Joined: 25 Nov 2010
Posts: 2

Posted: 25 Nov 2010 09:02:07 pm    Post subject:

\Hello. I would greatly appreciate it if you answer any one of my questions. I have started planning a program for factoring a quadratic equation (in the form y=ax^2+bx+c). I have some questions about creating this program.

The code for when B^2-4AC is a follows (I haven't yet decided the points for the text command so i will be showing you only what will appear on a calculator):

If B^2-4AC<0
Then:
Text(-B
Text("+sqrt"
Text("-"
Text(-B^2-4AC
Text(")"
Text("(imaginary number)"
Line (didn't decide)
Text( 2A)

1. Lets says that I get (-4 +- sqrt (Cooli )/ 2, how can I simplify sqrt(8 to 2sqrt(2)? Is a there a command for this? How can I then simplify the answer...to show -2+- sqrt(2)i as the simplified answer?

2. I have created the program for when A=1. Here is the display on the calculator for y=x^2+bx+c:

ROOTS ARE
-2,-3

(X+2 )
(X+3 )

I left a huge space between the 2 and the ) becuase I don't know how big the roots would. Is there a command on the TI-84 Silver Edition, in which I can determine how many digits a certain number consists of?

3. I haven't started to program for when a person inputs a perfect square like y=x^2+2x+1. I know that the calculator can display (X+1)(X+1) but can I make the calculator combine these to say (X+1)^2?

4. I haven't started to program this yet but what if the root are 1/3 and 1/2. How can I display the factored form as (2X-1)(3X-1) and not as (X-(1/2))(X-(1/3))?

5. Do you have any other suggestions or constructive criticism that I can use to make better programs in the future. I am a beginning programmer (started about 2 week ago) and a 13 year old so can you please explain in detail, if possible, some of the optimized code, but I would love it if you give me the simplified code.
Back to top
JustCause


Newbie


Joined: 26 Aug 2010
Posts: 2

Posted: 01 Dec 2010 04:38:51 pm    Post subject:

Welcome to UTI! Hope you enjoy your time here.

First things first, Text() will take multiple arguments: Text(0,0,"NUMBER IS ",B,"!"). Saves space and time.

When I was about your age, I made a program similar to this. Rather than telling it to find the roots, I had it use cycle through possible factored forms. It was slower than it could have been, but it worked...I'll see if I can recode it and post it here.

Simplifying square roots can be done by cycling through perfect squares and dividing the original number by them.

As for counting digits, int(log(X))+1 will give you the number of digits of X.

Also, you might find it useful to browse around Ticalc to find similar programs and study the source. You can learn a lot that way, it's pretty much how I learned BASIC.

TI-BD, or TI-Basic Developer, is a helpful site for learning to code better BASIC.

My time is limited right now, so I can't post any code, but I hope this tides you over until I can post some more detailed help.

Best of luck!
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement