What I would like to do is write a program for my TI-85 that will turn it into a construction calculator (i.e. a calc that will add, subtract, multiply and divide feet and inches). The reason I am trying to do this is that in my job I often have to calculate the area of something with holes, notches, etc. that I need to subtract from the total area. For example, I need to be able to multiply 40 feet 6 1/2 inches by 11 feet 2 3/4 inches and then subtract 4 feet 7 inches multiplied by 4 feet 11 3/4 inches. Right now in order to do this I use a construction calculator and write down all the multiples, then manually type in the subtraction. With my TI, I could potentially do everything in one step. Here's the problem: even though I have had this calc for roughly 20 years, I have never learned to program on it. Can anyone suggest a place for me to get information on beginning TI-85 programming? Also, where would I start to write this program?
Welcome to Cemetech, it's good to have you here. I recall that you were on #ti talking about problems with using your linking software with your TI-85; have you been able to resolve it? If you get a chance, be sure to Introduce Yourself. As far as programming tutorials go, the majority are for the TI-83+/84+ calculators, but most of the skills cross over:

http://tifreakware.net/tutorials
I would suggest looking through the manual and other 85 Basic programs on http://ticalc.org.

That said I do own a TI-86 which is very similar and I can see if I can help you whip something together. One important difference between the 85 and 86 is the 86 properly follows the order of operations where the 85 does not.


P.S. I am the Jonimus that helped you with your linking question on IRC and cemetech has its own IRC channel on efnet #cemetech, which is linked via a bot to the chat box to the left.
TheStorm wrote:
That said I do own a TI-86 which is very similar and I can see if I can help you whip something together. One important difference between the 85 and 86 is the 86 properly follows the order of operations where the 85 does not.
Weird, you learn something every day. What operation ordering does it mix up?
To quote the TI-86 guidebook
Quote:
TI-86 implied multiplication rules differ from those of the TI-85. For example, the TI-86 evaluates 1\2x as (1\2)*x, while the TI-85 evaluates 1\2x as 1\(2*x).


There are other slight differences as well but that is the one I could find quickly.
Thanks to you both! I need to get a silverlink cable and then I will be back. I will definitely try out both websites and look through the manual too. I appreciate your suggestions; they have made me feel very welcome!
TheStorm wrote:
To quote the TI-86 guidebook
Quote:
TI-86 implied multiplication rules differ from those of the TI-85. For example, the TI-86 evaluates 1\2x as (1\2)*x, while the TI-85 evaluates 1\2x as 1\(2*x).


There are other slight differences as well but that is the one I could find quickly.


I think I actually like that second version that the TI-85 performs better. I can't tell you how many beginner TI-83+ programmers write the Quadratic Equation like this and don't understand what's wrong with it:


Code:
:Disp (-B+sqrt(B^2-4AC))/2A
:Disp (-B-sqrt(B^2-4AC))/2A
Ok, I'm a beginner...what's wrong with it?
JazmynCat wrote:
Ok, I'm a beginner...what's wrong with it?


The "/2A" part is what is wrong; it's dividing by 2, and then multiplying by A, not dividing by (2*a) Smile
Ashbad wrote:
JazmynCat wrote:
Ok, I'm a beginner...what's wrong with it?


The "/2A" part is what is wrong; it's dividing by 2, and then multiplying by A, not dividing by (2*a) Smile


I always treat variables as (2a) unless it's explicitly (2)*(a); looking back it's probably why I kept failing math later on in my education.
Jazmyn, don't worry too much about that; we're just geeking out with EOS trivia here. Chances are that if a program like yours you won't run into this sort of thing. Getting back to your program, it seems to me that each time the user enters a value, you'll need to ask them to input two things, the feet and then the inches. You can store this as feet+(inches/12), I suppose, but I think you'll get fewer math and round-off errors if you store each value in a two-element list of [feet, inches]. Then again, while adding two such things is easy (this is pseudocode):


Code:
feetC = feetA + feetB
inchesC = inchesA + inchesB
if inchesC >= 12 {
    inchesC = inchesC - 12
    feetC = feetC + 1
}
, I could see things like multiplication and division getting headache-y.
Why not store everything as inches, do the calculations, and convert back to feet and inches?
souvik1997 wrote:
Why not store everything as inches, do the calculations, and convert back to feet and inches?

^^ This.

It's easy to convert inches to feet+inches. Pseudocode:

Code:
feet = int(inches/12)
inches = inches - feet*12

"int()" is a function that takes the integer part of the number inside, so (for example) int(1.25) = 1.

It's even easier to convert feet+inches to inches. More pseudocode:

Code:
inches = inches + feet*12
souvik1997 wrote:
Why not store everything as inches, do the calculations, and convert back to feet and inches?
Because I didn't have enough sleep slash coffee yesterday and wasn't thinking straight. Smile Thanks, Souvik, that is indeed the obvious good solution both for simplicity and avoiding rounding problems.
  
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 1
» 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