• 0

HELP! My TIBASIC program won't run!


Question

hi, i've made a program (a rather lengthy one at that) for probability and statistics. it's for my TI-84 Plus calculator. i have a menu at the beginning, and a section of the program runs according to which key is pressed. (the variable U is assigned the number of the key pressed) however, it will not run if i choose option 6 or 7. (i did not include the menu. these are options 5,6,and 7)

"------5----MEAN
If U=83:Then
ClrHome
Disp "1.ERROR"
Disp "2.INTERVAL"
0->U
While U=0
getKey->U
End

If U=92:Then
ClrHome
Input "CONFIDENCE:",C
Input "SAMPLESIZE(N):",N
Input "ST.DEV:",?
(100-C)
(Ans/100)
(Ans/2)
invNorm(Ans)
abs(Ans)
round(Ans,2)->Z
(Z*(?/?(N)))->E
round(E,2)
ClrHome
Disp "ERROR:",E
Output(1,1,"")
Else

If U=93:Then
ClrHome
Input "CONFIDENCE:",C
Input "SAMPLESIZE(N):",N
Input "ESTIMATE(?):",X
Input "ST.DEV:",?
(100-C)
(Ans/100)
(Ans/2)
invNorm(Ans)
abs(Ans)
round(Ans,2)->Z
(Z*(?/?(N)))->E
(X-E)->A
(X+E)->B
round(A,1)->C
round(B,1)->D
ClrHome
Disp "INTERVAL:"
Output(2,1,C)
Output(2,5,"<M<")
Output(2,8,D)
Output(3,1,"UNROUNDED? Y/N")
0->U
While U=0
getKey->U
End

If U=92:Then
ClrHome
Disp A,"<M<",B
Output(1,1,"")
Else

If U=71 or U=45
Output(1,1,"")
End

"----6---SAMPLE
Else
If U=84:Then
ClrHome
Input "ERROR:",E
Input "CONFIDENCE:",C
Input "ST.DEV:",?
(100-C)
(Ans/100)
(Ans/2)
invNorm(Ans)
abs(Ans)
round(Ans,2)->Z
((Z*?)/E)->N
ClrHome
Disp "SAMPLESIZE:",N
Output(1,1,"")
Else
"----7---CLEAR
If U=72 or U=45:Then
ClrHome
Output(1,1,"")
End

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I'm afraid I don't know the syntax of TIBASIC but I'd suggest your If/Else loops aren't quite written correctly - that'd be the bit to investigate. Seems odd to me that the section for option 6 would start with an ELSE statement. I'm sorry I couldn't help more than that.

Link to comment
Share on other sites

  • 0
I'm afraid I don't know the syntax of TIBASIC but I'd suggest your If/Else loops aren't quite written correctly - that'd be the bit to investigate. Seems odd to me that the section for option 6 would start with an ELSE statement. I'm sorry I couldn't help more than that.

i wrote another program with if/else loops that exact same way, and that works fine. however, the other program doesn't have nested if/else loops like this one does. the entire program is essentially a bunch of if/else loops. i think the problem is with the End/Else statements at the end of section 5, due to the nested loops. the first four sections are written with the same if/else syntax, and they work.

Link to comment
Share on other sites

  • 0
Did you mean to check for U=92 twice?

that's supposed to be a nested loop. it checks for 92(the address of the "1" key) and takes you to another menu, which gives you options and waits for the key 1 or 2 to be pressed. was that clear, i think i might not have explained it right.

Link to comment
Share on other sites

  • 0

I think the ELSE statements at the start, and end of section 6 are un-necessary. At least giving the code a quick scan by eye and matching up the if/else/end's. Humour me, try removing them and see if it works?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.