TIB: Re: TI-B:Two Questions


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

TIB: Re: TI-B:Two Questions





----- Original Message -----
From: Christoph Bergemann <mathwizard@gmx.de>
To: <ti-basic@lists.ticalc.org>
Sent: Saturday, May 20, 2000 4:17 PM
Subject: TIB: TI-B:Two Questions

> Second: I want to create a program, where a function of x is taken as an
> input and then iterated. Like this:
> Input: A function (g(x))
> It now takes a starting value a and calculates g(a), then g(g(a)) and then
>
> g(g(g(a))) and so on. How can I take the function as input.

This will work if you have a to start with

For the input, take a string, with a promt like "g="
Do a sting to eqation, With the new equation as g
Prompt for a, and store it.
Then ask for the number of times you want to iterate, and store as a
variable, such as y
Set up a for end loop, use another variable, like x, start at 1, end at y,
step up 1 each time
Store the value of equation g to a
end the for end loop
display a
end the program

I hope this is want you want.

B Clark




References: