Hi, I have a couple of questions. I guess some of them are already asked, but my internet is being stupid, and I do not wish to spend eternity looking around to see whether this has been asked before or not.
The questions all have to do with a simple program I am trying to write. It has little use, but it is good practice, I think.
The program is like this:
It finds the derivatives (and later anti-derivatives) of simple polynomial functions. That's it. Later, I want to expand it, but for now, it doesn't matter.
First question:
I have made a short do loop
In it, I use the input command, and store the data in a string task$.
Next, I want to go to a function that has the same name as the string task$, so I tried task$().
Say, I have a function (outside of the loop) called derive().
So if I'd input "derive", I want to go to the function called derive().
Obviously, this doesn't work, but is it possible to do this, and if so, could someone tell me how?
Second question:
(Maybe a bit confusing. I apologise for that)
Say, I have this code:
for n=1 to (polyTerms-1)
print ""
print "Please specify the number multiple in front of the ", n, "th term: "
input a
print "The derivative of this term is: ", (polyTerms-n), "*", a, "x^", (polyterms-n-1)
next n
This is not what I really want.
The program first asks for the amount of terms in the polynomial, so that is the highest power of x plus one, for those who know what I'm talking about.
I want to find the symbolic derivative of the polynomial by deriving each term ((d/dx)ax^n=(nax^(n-1) for each term seperately).
So I want to use a for next loop, as above, but differently.
I want to have the constant multiple of each term, and store it somehow, so that I can write the entire derivative in one go later on.
So something like this:
for n=1 to (polyTerms-1)
print ""
print "Please specify the number in front of the ", n, "th term: "
input a
next n
But this of course does not store the value of a for each term, but simpy overwrites it.
How could I store every seperate value for a easily, and still be able to use them later on? (After the for next loop)
That is it for now, I am afraid I will be asking more later, but now I have to walk my dog, because he is starting to get desperate :p.
Thank in advance