Jump to content



Photo
- - - - -

Need Help For A Program


  • Please log in to reply
9 replies to this topic

#1 scientifix

scientifix

    Casio Addict

  • Members
  • PipPipPip
  • 78 posts

  • Calculators:
    fx9860gII

Posted 20 April 2013 - 03:36 PM

hi guys,
I have some questions for you :
here is my program :

?->N
Int N->I
Frac N->F
For 1->D To 1000
F×D->N
If Abs (Int (N+.5)-N)<1[size=1]E[/size]-10×D
Then Int (N+.5)->N
Break
IfEnd
Next
I[i][a b/c][/i]N[i][a b/c][/i]D[i][a b/c][/i]

I have a problem with "size" (line 6) I don't know how to get it, it is not in the "character menu" and its not in the <span class=Shift' /> <span class=4' /> Menu.
I also have a problem with the last line, do I have to writte it with the letters of the character menu (I mean for a,b,c,i) ?

Thanks a lot !
scientifix

Edited by scientifix, 20 April 2013 - 03:39 PM.


#2 shinolife63

shinolife63

    Newbie

  • Members
  • Pip
  • 25 posts
  • Gender:Male

  • Calculators:
    Classpad CP-400
    Classpad CP-330
    fx-9860gii
    Hacked fx-9750gii
    fx-300 ES plus
    fx-115 ES
    fx-300 MS

Posted 20 April 2013 - 04:09 PM

Line 3 should look like:
for 1->D to 1000 step 1


#3 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 20 April 2013 - 06:13 PM

No, "Step 1" is not required, if it's omitted, the stepsize is assumed to be 1.
But line 6 looks like you need the exponent sign, which is on the keyboard: <span class=EXP' />

#4 shinolife63

shinolife63

    Newbie

  • Members
  • Pip
  • 25 posts
  • Gender:Male

  • Calculators:
    Classpad CP-400
    Classpad CP-330
    fx-9860gii
    Hacked fx-9750gii
    fx-300 ES plus
    fx-115 ES
    fx-300 MS

Posted 20 April 2013 - 06:59 PM

Really? Thats a nice piece of information for making my programs a bit smaller. :thumbsup:

#5 scientifix

scientifix

    Casio Addict

  • Members
  • PipPipPip
  • 78 posts

  • Calculators:
    fx9860gII

Posted 21 April 2013 - 10:55 AM

Hi guys,
I found the problem, a b/c stands for "fraction" -->"/"
I have an other problem, when I enter -1.125 it should give me -9/8 but the program gives me 9/8 which is wrong ! and it's the same with all negativ numbers !
Can you help me to correct the program ? (when I enter negativ numbers the program is taking a long time to give me an answer and this answer is wrong !)
I have an idea : at the begining of the program I should make something like "Abs(N)" and at the end of the program make something like "N was negativ so make I/N/D (the fractional answer) time -1" to have it in a negativ form.
Can someone help me ?

#6 scientifix

scientifix

    Casio Addict

  • Members
  • PipPipPip
  • 78 posts

  • Calculators:
    fx9860gII

Posted 21 April 2013 - 11:20 AM

I found this which is much better !
?® Y
Abs Y ® X
Int X ® Z
1E-8® T
Z ® P
1 ® Q
If Abs(X-Z)<=T Or Abs(X-Z)<=TX
Then Goto 2
IfEnd
1 ® G
Z ® H
0 ® E
1 ® F
Do
1÷(X-Z)® X
Int X ® Z
HZ + G ® P
H ® G
P ® H
FZ+E ® Q
F ® E
Q ® F
LpWhile Abs(AbsY-P÷Q)>T
Lbl 2
If Y<0
Then
-P ® P
IfEnd
P/Q

#7 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 21 April 2013 - 05:24 PM

Just curious, why does that code have a bunch of ® symbols in it?

#8 amin_heidari

amin_heidari

    Casio Addict

  • Members
  • PipPipPip
  • 73 posts
  • Gender:Male
  • Location:Persia
  • Interests:Computer
    Programing
    Electrical Engineering

  • Calculators:
    CASIO FX-9860G SD hacked to G|| OS Version 2.01

Posted 21 April 2013 - 06:21 PM

are you try to write a program for convert Decimal to Fraction !?
see this program authored by Roy F.A. Maclean & rewrite and enhanced by me for 9860G some years ago
however i never published it because new OS have this feature in Math mode.

go to below page and click on red button( Posted Image ) to start downloading

http://s4.picofile.c...c_V0_1.rar.html

Edited by amin_heidari, 21 April 2013 - 06:28 PM.

  • MicroPro likes this

#9 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 23 April 2013 - 11:52 AM

Really? Thats a nice piece of information for making my programs a bit smaller. :thumbsup:

It's in the manual. Reading it usually helps. (Except for the If ... Then ... [Else ...] IfEnd - the manual says you can omit the IfEnd, which is wrong.)

#10 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 23 April 2013 - 04:01 PM

Another trick to know is that you don't need the closing parentheses on commands. So RandInt(1,3) and RandInt(1,3 do the same thing. ;)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users