Author Topic: Ready to give up on a program (since I can't just pull my hair out)  (Read 8179 times)

0 Members and 1 Guest are viewing this topic.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #15 on: January 07, 2011, 02:49:50 pm »
Forgot to mention here that I've gotten it to work.

Everyone also forgot to mention that you need End at the end of an If/Then/Else statement. If you need anymore help just let us now :)
It's alright, though, I already knew about that anyways. And thanks for the offer, but I already knew that everyone here is willing to help me out if I just ask (I speak from experience, in fact).

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #16 on: January 08, 2011, 08:31:13 pm »
Cool to hear. ;D

About End statements, in TI-BASIC for the 83+ it's even more confusing because unlike other languages, there's one End instruction for everything, instead of EndWhile, EndIf, Next and EndRepeat, so when you have about 5 nested ifs/for/whiles along with a few scattered ifs in your code, it gets confusing to figure out how many End commands you need at the end.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #17 on: January 10, 2011, 12:03:46 pm »
* holmes221b wasn't able to start a new thread for this (school connection isn't allowing me to start new topics anywhere on Omnimaga)

So today in Precalculus II, we started learning about angles and their measure (that's practically the actual title of the section). During that time, I came up with two different ideas for new programs to code:
-a program to convert radians to degrees, minutes, seconds as well as convert degrees, minutes, seconds to radians
-a program to convert decimals to degrees, minutes, seconds as well as convert degrees, minutes, seconds to decimals.

My question is this: Is it possible to create a program to do the latter? The reason I ask this is because in my textbook it mentions that to convert decimals to degrees, you have to change the calculator's mode to get the correct answer.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #18 on: January 10, 2011, 12:52:06 pm »
My question is this: Is it possible to create a program to do the latter? The reason I ask this is because in my textbook it mentions that to convert decimals to degrees, you have to change the calculator's mode to get the correct answer.
Very likely. I'm not sure how to do it, though.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #19 on: January 10, 2011, 01:28:12 pm »
-a program to convert decimals to degrees, minutes, seconds as well as convert degrees, minutes, seconds to decimals.

My question is this: Is it possible to create a program to do the latter? The reason I ask this is because in my textbook it mentions that to convert decimals to degrees, you have to change the calculator's mode to get the correct answer.

It's possible and actually quite easy. I don't have my link cable right now, so here's the code:

Code: [Select]
Menu("","▶DMS",A,"▶Dec,B
Lbl A
Input "Decimal? ",A
ClrHome
60fPart(A→B
60fPart(B→C
Disp int(A),int(B),int(Ans
Pause
Stop
Lbl B
Input "D? ",A
Input "M? ",B
Input "S? ",C
(C/60+B)/60+A
Disp Ans
* Qwerty.55 waits for Runer to reduce the code size down to six bytes with his incredible optizimations
« Last Edit: January 10, 2011, 01:29:15 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #20 on: January 10, 2011, 02:16:53 pm »
Instead of
Code: [Select]
Input "D? ",A
Input "M? ",B
Input "S? ",C
, maybe you could use
Code: [Select]
Prompt D,M,S
instead? :P

And maybe change Decimal to DECIMAL.

EDIT: Instead of:
Code: [Select]
Disp int(A),int(B),int(Ans
Pause
do this:
Code: [Select]
Disp int(A),int(B
Pause int(Ans

EDIT2: I think you misspelled the first line. It should be Menu("","▶DMS",A,"▶Dec",B, not Menu("","▶DMS",A,"▶Dec,B
« Last Edit: January 10, 2011, 02:19:42 pm by JosJuice »

SirCmpwn

  • Guest
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #21 on: January 10, 2011, 02:22:33 pm »
My question is this: Is it possible to create a program to do the latter? The reason I ask this is because in my textbook it mentions that to convert decimals to degrees, you have to change the calculator's mode to get the correct answer.
Not only is it possible, it's built into TIOS.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #22 on: January 10, 2011, 04:36:03 pm »
Not only is it possible, it's built into TIOS.
Can you tell I don't have an owner's manual for my calculator? xD

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

SirCmpwn

  • Guest
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #23 on: January 10, 2011, 04:36:27 pm »
Can you tell I've read mine cover to cover? XD

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #24 on: January 10, 2011, 05:06:13 pm »
I think I can make a smaller program than what you've all come up with for me (if you remove the "fluff" I added to make it into a "proper" program)...whether or not it actually works though, I don't know yet, I haven't tried this out on my calc yet. Also, it's set up with the assumption that you have already set your mode to DEGREE.

Code: ("prgmDMS2D") [Select]
:Lbl A
:Input "DMS=1, DEC=2", N
:If N=1:Then
:ClrHome
:Prompt D,M,S
:Disp DºM'S''
:Pause
:Goto B
:End
:If N=2:Then
:ClrHome
:Prompt N
:Disp N▶DMS
:Pause
:Goto B
:End
:If N≠1
:If N≠2
:Then
:ClrHome
:Disp "TRY AGAIN!"
:Pause
:Goto A
:End
:Lbl B
:ClrHome
:Input "PRESS 1 TO REPEAT", X
:If X=1:Then
:Goto A
:End
:If X≠1:Then
:Stop


edit: Okay it doesn't work. Keeps getting ERR:SYNTAX on the DMS to DEC section of the code.
« Last Edit: January 10, 2011, 05:16:23 pm by holmes221b »

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #25 on: January 10, 2011, 05:33:17 pm »
Some of those If's won't work, I don't think...
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #26 on: January 10, 2011, 05:35:42 pm »
They all should, this code is based off of Chemitab 83+

doesn't mean that they will work, though.
« Last Edit: January 10, 2011, 05:36:36 pm by holmes221b »

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline c.sprinkle

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 221
  • Rating: +23/-1
  • There ain't no rest for the wicked? True indeed.
    • View Profile
    • The Corread on NationStates.
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #27 on: January 10, 2011, 05:40:59 pm »
Try this:
Code: ("prgmDMS2D") [Select]
:Lbl A
:Input "DMS=1, DEC=2", N
:ClrHome

:If N=1
:Then
:Prompt D,M,S
:Disp DºM'S''
:Goto B
:End

:If N=2
:Then
:Prompt N
:Disp N▶DMS
:Goto B
:End
:If N≠1 and N≠2
:Then
:ClrHome
:Disp "Try again!"
:Pause
:Goto A
:End

:Lbl B
:Pause
:ClrHome
:Input "PRESS 1 TO REPEAT", X
:If X=1
:Goto A
:If X≠1
:Stop

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #28 on: January 10, 2011, 05:42:10 pm »
Er, Raylin's right.

When you have more than one line in a conditional, you must always have
Code: [Select]
If <condition>:Then
<Code>
<Code>
End

If you do not have a :Then statement, then the calculator does this instead:
Code: [Select]
If <Condition>
<line of Code to be executed if the condition is true and skipped if false>
<line of code to be executed if the condition is false and skipped if true>
<rest of code>

Any End statements are regarded as not having associated commands and bring up errors. You didn't follow the conditionals correctly, so that's probably at least one problem with your code.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #29 on: January 10, 2011, 05:43:27 pm »
I can't even get that far in it, because of the ERR:SYNTAX.
It doesn't like the M' part.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX