0
Menu("RADIAN CONVERSION","DEGREE TO RADIAN",1,"RADIAN TO DEGREE",2
Lbl 1
Input "DEGREE=",C
C/180⯈Frac→W
Goto 3
Lbl 3
Goto 4
Lbl 2
Input "RADIAN=","LEAVE OUT PIE",A
A(180)→D
Goto 5
Lbl 4
Disp "RADIAN",P
Lbl 5
Disp "DEGREE=",D
Stop

The error is in line 4. I know there are easier ways to do this but I just wanna learn.

Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30

1 Answers1

0

Due to the language of TI-BASIC, variables aren't stored as fractions; they are floating point numbers. When you want to display a variable as a fraction, use the ⯈Frac command in the Disp command itself. Note that this does not automatically display later values as fractions. Here is some code with // to mark a comment at the end of the line.

Input "DEGREE=",D
180/D→R                  // R is not a fraction.

...

Lbl 4
Disp "RADIAN=",R⯈Frac    // TI-OS displays R as a fraction.

...

Disp "RADIAN=",R         // Will not display as a fraction.
Stop
clevor
  • 28
  • 3