My task was to write a program that asks the user for 5 percent grades (storing them in the marks[] array), and then calculates the student's final mark using the weighting scheme stored in weights[]. We were supposed to use functions for this problem. I wrote the code but it keeps showing an error which I have tried to resolve but couldn't. Here is my code:
When defining a routine, as you are beginning on line 3, you don't put a semicolon after the parameter list. Doing so makes you think you're declaring, not defining, the function.
I'm not sure, since you left out the actual error message you got. But, in your function definitions, you can't specify array sizes. Getting rid of the "5"s would be a good thing to do, whether or not it solves your problem.