Hi,
That's better :+)
Lines 24 & 25 are meant to be function declarations - they need to be before
main()
and each parameter should have a type. Function parameters are normally marked
const
.
The function definitions for those same two functions should appear after
main()
- one cannot define functions inside another, including
main()
which is just another function.
You are already using arrays, is there any reason why the grades are not in an array? If they were, you could use a
for
loop in your
min
/
max
functions.
With line 14, you have defined a
const
variable which is excellent, just need to make use of it throughout the code, rather than putting 4 everywhere.
Have you learnt about
struct
s yet? These are useful to use, instead of having multiple arrays for related things, one has an array of
struct
Good Luck !!
Edit:
The
min
/
max
functions could return a
const
value as well:
const int min(/* your parameters here */);
This business about
const
is called const correctness - use const wherever you can