HI,
I had these compile errors:
4:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wpedantic] In function 'int main()':
31:21: error: 'system' was not declared in this scope |
The first one is obvious: it's always
int main()
I would change the
float
type to
double
everywhere, the precision of
float
is easily exceeded. Remember to change the
printf
to reflect that.
With the
steps
variable, I would do this:
6 7 8 9 10
|
int i = 0; // step counter always initialise
const std::size_t steps = 10000; // could use unsigned int if you want
double theta [steps]; // initial value for angle Is this so you can test 10000 different values?
const double omega = 0.2; // initial value for angular speed
double time [steps]; // initial time
|
This avoids having "magic" numbers like 10000 throughout the code.
I would also consider better variable names, if it is an initial value consider putting the word
Initial in the variable name.
With the testing, it sounds to me that you teacher wants you to write more code to show the testing. Get some input from the user for all the variables, show all the results for each one. If using one of the
scanf
functions, make sure you use the return value to see that it worked.
Good Luck !!