Computer Science Canada program help |
Author: | Geminias [ Tue Oct 04, 2005 8:13 pm ] | ||
Post subject: | program help | ||
hey, i'm a noob having some trouble with this program. Won't compile and i don't understand the compiler's hints. If anyone could give me some pointers on what is wrong please do so. Syntax = C++
|
Author: | wtd [ Tue Oct 04, 2005 8:27 pm ] | ||
Post subject: | |||
Well, there are many things wrong with your code, but one stands out in particular. "sin" is a function. Why aren't you calling it as such?
|
Author: | Geminias [ Tue Oct 04, 2005 8:28 pm ] |
Post subject: | |
i thought it was more like an operand |
Author: | wtd [ Tue Oct 04, 2005 8:30 pm ] | ||
Post subject: | |||
Also, where is "displacement" declared?
|
Author: | md [ Tue Oct 04, 2005 8:42 pm ] | ||
Post subject: | |||
I was going to write a nice big thing here but sicne I seem to have been beaten to it while writing it I'll just post some fixed code so you can see it working:
|
Author: | Geminias [ Tue Oct 04, 2005 9:29 pm ] |
Post subject: | |
thanks guys. But one question. you put "sin(s*t)" is that the same as "sin(s) * (t)" ? because it is not the same thing on a calculator. |
Author: | wtd [ Tue Oct 04, 2005 9:48 pm ] |
Post subject: | |
No. You have the function name, then parentheses. Inside the parentheses are any argument(s) to the function. In this case the argument is "s * t". |
Author: | [Gandalf] [ Tue Oct 04, 2005 10:26 pm ] |
Post subject: | |
Nice new sig, wtd You were also missing some ';''s from the end of some lines, try to check that first if you get some errors (which should easily tell you that this is the problem). |