Jump to content



Photo
- - - - -

If Statement Error....help


  • Please log in to reply
21 replies to this topic

#1 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 01:13 PM

Hi

I'm trying to make a little program for my casio cfx and he gives me an error i don't know why.

The code is this.


"Calculo assimetria"
"Insira a media d x"?ºM
"Insira a mediana"?ºA
"Insira o dp"?ºP
"Assimetria e d:"
3*((M-A)/P)->V
If V<0
Then "Assimetria negativa"
Else "Assimetria positiva"
If End


#2 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 03 May 2012 - 01:44 PM

Hello Gil and welcome to UCF!
You should introduce yourself here: http://www.casiocalc...?showtopic=5677 ;)

What error does it give?

#3 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 01:53 PM

Hi

Already made the presentation :)

It gives Syn error

don't know why

I have follow this tutorial

1->A
If A=1   //expression to be evaluated
Then “HI”  //result if expression is true
“HOW ARE YOU”
Else “BYE”  //result if expression is false
“SEE YOU LATER”
If End   //end of statement

You see any error??

regards

#4 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 03 May 2012 - 01:57 PM

"Calculo assimetria"
"Insira a media d x"?ºM
"Insira a mediana"?ºA
"Insira o dp"?ºP
"Assimetria e d:"
3*((M-A)/P)->V
If V<0
Then "Assimetria negativa"
Else "Assimetria positiva"
If End


The "º" should be changed to "->"

#5 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 02:07 PM

"Calculo assimetria"
"Insira a media d x"?->M
"Insira a mediana"?->A
"Insira o dp"?->P
"Assimetria e d:"
3*((M-A)/P)->V
If V<0
Then "Assimetria negativa"
Else "Assimetria positiva"
If End

Doesn´t work either..

Syn error after

"Assimetria e d:

#6 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 03 May 2012 - 02:18 PM

Is ((M-A)/P) a real number? (If P is zero, you will get an error)

What did you input for all the numbers?

#7 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 02:22 PM

Without the if statement it works and make me the right calculation

The numbers i'm trying are

10.55

10.57

0.21

by this order...and he gives me 0.28

Now i want to have the if statement saying if the calculation is <0 i have the first sentence, else i have the other sentence.

This is statistic assemitry program

regards

#8 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 03 May 2012 - 03:10 PM

The answer should be -0.2857142857. (Simplified, that's -0.29, not 0.28)

Your code works on my calculator. Try this:

"Calculo assimetria"
"Insira a media d x"?->M
"Insira a mediana"?->A
"Insira o dp"?->P
ClrText
"Assimetria e d:"
3*((M-A)/P)->V
V<0 => "Assimetria negativa"
V>0 => "Assimetria positiva"


#9 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 03:31 PM

Hi

Doesn't work either

i put all

"Calculo assimetria"
"Insira a media d x"?->M
"Insira a mediana"?->A
"Insira o dp"?->P
ClrText
"Assimetria e d:"
3*((M-A)/P)->V
V<0 => "Assimetria negativa"
V>0 => "Assimetria positiva"

It gives error after

"Assimetria e d:"

I have put only

"Calculo assimetria"
"Insira a media d x"?->M
"Insira a mediana"?->A
"Insira o dp"?->P
ClrText
"Assimetria e d:"
3*((M-A)/P)->V

and i have the same error, so the line should be this one

3*((M-A)/P)->V

My calculator is cfx-9850GB plus...does it matters??

regards

#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 03 May 2012 - 03:36 PM

I don't think it should matter...I have a PRIZM and an FX-9750GII. It works for me on both. Can you reset your setup data on your calculator?

#11 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 03:49 PM

Hi

I did the reset and still not working.

It's really strange if it works with you....and not with me, maybe my calculator has something wrong.

regards

#12 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 03 May 2012 - 04:23 PM

Are you using the "if" command by pressing <span class=Shift' /> <span class=MENU' /> <span class=F1' /> <span class=F1' />, or are you typing it in?

#13 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 06:23 PM

I use a program called FX-Interface Pro for cfx. why?

#14 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 03 May 2012 - 07:42 PM

That may be the problem. Try doing it in program mode on the CFX.

Does the CFX use g1r files? If so, I can give you a test program to try.

#15 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 07:53 PM

No, it uses *.cat files.

#16 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 03 May 2012 - 07:54 PM

Oh. Are you programming on the actual calculator?

#17 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 08:05 PM

No, i'm using FX-Interface Professional, i choose my model and then i can program it, all is working ok with simple instructions.

#18 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 03 May 2012 - 08:06 PM

So you don't own an actual calculator?

#19 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 08:27 PM

Yes, i have a cfx-9850GB plus

But it's much more easier to program trought my pc rather than the calculator.

regards

#20 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 03 May 2012 - 08:29 PM

Have you tried programming this on your calculator instead of the PC?

#21 Gil

Gil

    Newbie

  • Members
  • Pip
  • 15 posts

Posted 03 May 2012 - 08:56 PM

I will try it tomorrow, let you know after.

Thanks

#22 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 03 May 2012 - 09:18 PM

Ok. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users