Jump to content



Photo
* * * * * 1 votes

How do I replace a variable in Casio Basic

Casio Basic Casio Variable Replace

  • Please log in to reply
1 reply to this topic

#1 SquareUnicorn

SquareUnicorn

    Newbie

  • Members
  • Pip
  • 1 posts

  • Calculators:
    Casio ClassPad II
    Ti 84

Posted 03 April 2019 - 06:13 PM

Hey there!

 

I just started programming in Casio Basic on my ClassPad 2, but I can't get over this problem.

I want to replace the 'x' in f:

 

5ax² => f

f | x=0 'this works perfectly fine in the main section of the calculator, but it won't change f in the program

 

Does anyone know how this works here?

 

SquareUnicorn


Edited by SquareUnicorn, 03 April 2019 - 06:14 PM.


#2 pan.gejt

pan.gejt

    Casio Freak

  • Members
  • PipPipPipPip
  • 262 posts
  • Gender:Male
  • Location:CZ

  • Calculators:
    .

Posted 04 April 2019 - 04:59 AM

You can try my proposal of the code, let's take your function and define the function directly in the code.

 

ClrText

Define f0(x)=5×a×x^2

Input x,"evaluate at"

Print "f0(x)=", ColorRed

Print f0(x), ColorRed

 

Comment:

You can rename f0 to f1, f2 according to your preferences

Optionally you can add input box for parameter a

Optionally you can change the color of the result

-----------------------------------

If you would like to define your function outside the program (not directly), just see chapter 12-3 page 203 







Also tagged with one or more of these keywords: Casio Basic, Casio, Variable, Replace

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users