Re: TIB: (no subject)


[Prev][Next][Index][Thread]

Re: TIB: (no subject)




Reola920@aol.com wrote:
> 
> The problem: I can't figure out how to write a program that will display or a
> "yes" or "no" if the answer "C" is a fraction.  Here's what I have so far.
> 
> :Prompt A,B
> :A/B->C
> :If C< or equal to .9
> :Then
> :Disp "no
> :End
> :If C>.9
> :Then
> :Disp "yes
> :End
> 
> This is all I can think of on how to do the program. There are problems
> sometimes it kicks out yes and no at the same time.  Also, I know there is an
> easier ways to write this, and I would appreciate the help.

What does .9 have to do with being a fraction? What if you had the 
number 1.5? This is also a fraction - 3/2. I would recommend something 
like this. 
:A/B
:If fPart(Ans)=0
:Then
:Disp "YES
:Else
:Disp "NO
:End

You could also use the int( command. 
:If A/B=int(A/B
:Then
:Disp "YES
......

Just what is the program for, anyway?

Jody Snider
jody1@alaska.net


References: