Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 6th, 2005, 3:11 PM   #11
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 572
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
How do you make a variable unknown in TI-83+ Basic?
crawforddavid2006 is offline   Reply With Quote
Old Apr 6th, 2005, 3:15 PM   #12
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
Quote:
Originally Posted by crawforddavid2006
How do you make a variable unknown in TI-83+ Basic?
you can "delvar <variable>" or just set it to 0; you don't have many options with basic. when a variable is delvar'ed it's still equal to 0; it just doesn't occupy any memory space.
chepfaust is offline   Reply With Quote
Old Apr 6th, 2005, 3:20 PM   #13
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 572
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Sorry i should have specified. What i meant was in my program i want it to go to a different equation if the variable is unknown. How can i do that?

Last edited by crawforddavid2006; Apr 6th, 2005 at 3:24 PM. Reason: Typo
crawforddavid2006 is offline   Reply With Quote
Old Apr 6th, 2005, 3:38 PM   #14
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
Quote:
Originally Posted by crawforddavid2006
Sorry i should have specified. What i meant was in my program i want it to go to a different equation if the variable is unknown. How can i do that?
i'm pretty sure the only way you'll be able to do that is if you say "if <variable> = 0..." but that of course would cause problems if a known variable happens to equal 0.

so, as far as i know (and i used 83+ basic a LOT back in the day) there is no way to determine if a variable is unknown using basic.

if you were trying to make a program that would solve for a given variable in the equation like "x + y = z" ...

prompt x,y,z

have the user enter something conspicuous that a user would probably never actually type the entire length of like sin(69) or pi for the value of the unknown variable. then you can just check to see which variable equals sin(69) or pi and go from there. it's not the most intuitive and userfriendly solution, but it would get the job done.

Last edited by chepfaust; Apr 6th, 2005 at 3:41 PM.
chepfaust is offline   Reply With Quote
Old Apr 6th, 2005, 5:32 PM   #15
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 572
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
that did not work so i tried something else which helped here is an example

[begining of code]

Disp "UNKOWN=X"
Disp "ENTER A"
Input A
Disp "Enter B"
Input B
Disp "Enter C"
Input C
If C=X
√(A² + B²)→C
If B=X
√(C²-A²)→B
If A=X
√(C²-B²)→A
Disp “Answer Is”
Disp “A”
Disp A
Disp “B”
Disp B
Disp “C”
Disp C

Last edited by crawforddavid2006; Apr 6th, 2005 at 5:41 PM. Reason: i have no idea why it did smilies
crawforddavid2006 is offline   Reply With Quote
Old Apr 6th, 2005, 7:45 PM   #16
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 572
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
This is for one of my programs could you please help

i am trying to solve for “T” could u help?

P = Principal
R = Rate in decimal
N = Number of times compounded a year
T = Number of Year Compounded
A = Finishing Amount

A = P(1 + (R/N))NT

And after that could u help me solve for “N”
crawforddavid2006 is offline   Reply With Quote
Old Apr 6th, 2005, 9:28 PM   #17
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
Quote:
Originally Posted by crawforddavid2006
that did not work so i tried something else which helped here is an example

[begining of code]

Disp "UNKOWN=X"
Disp "ENTER A"
Input A
Disp "Enter B"
Input B
Disp "Enter C"
Input C
If C=X
√(A² + B²)→C
If B=X
√(C²-A²)→B
If A=X
√(C²-B²)→A
Disp “Answer Is”
Disp “A”
Disp A
Disp “B”
Disp B
Disp “C”
Disp C
this program isn't going to work because x is a numerical value that is 0 by default. so if the user types in "x" for the variable they don't know, the calculator will interpret it as 0, and you'll have the problem i mentioned earlier. if another program you used stored a different value to x already, say, 14, your output is going to be seriously skewed because the calculator will interpret x as 14--NOT an unknown number.

if what i suggested didn't work, then you probably didn't implement it correctly. try this: replace all instances of "x" with pi. not just 3.14, i'm talking about the pi variable you get when you push 2nd ^. this way, in order to throw the program off the user would physically have to type 3.141592654 (assuming you're in float mode, where decimals don't get rounded).

so the first line would be disp "UNKNOWN=<pi character>" and your if statements would be if A=<pi character> then / if B=<pi character> then / etc.

Last edited by chepfaust; Apr 6th, 2005 at 9:37 PM.
chepfaust is offline   Reply With Quote
Old Apr 6th, 2005, 9:35 PM   #18
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
Quote:
Originally Posted by crawforddavid2006
This is for one of my programs could you please help

i am trying to solve for “T” could u help?

P = Principal
R = Rate in decimal
N = Number of times compounded a year
T = Number of Year Compounded
A = Finishing Amount

A = P(1 + (R/N))NT

And after that could u help me solve for “N”
ugh, math is NOT one of my strong points

you do know the 83/83+ has a built-in equation solver that is much more powerful than anything one can write in basic? if you can rearrange the variables to make the equation equal to 0, you can put the equation in the solver and let the calculator handle the rest. it will only solve for "x" but "x" is equivalent to "t" in your case.

furthermore, if you have the pc-to-calc link cable, i'm pretty sure either TI themselves or a third party at ticalc.org has released a full-blown equation solver that you can flash onto the calc. you might want to look into that.

i'm -seriously- retarded when it comes to figuring out anything more complex than simple addition and subtraction, so sorry i can't help you with this particular situation
chepfaust is offline   Reply With Quote
Old Apr 7th, 2005, 7:18 AM   #19
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 572
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Thanks anyways
David
crawforddavid2006 is offline   Reply With Quote
Old Apr 7th, 2005, 7:50 AM   #20
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Umm...

A = P(1 + R)^(NT)
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC